mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-18 11:19:10 +00:00
Use unicode for key events despite the fact that our current Plasma20 fonts only support latin-1
This commit is contained in:
@ -519,7 +519,8 @@ hsBool pfConsole::MsgReceive( plMessage *msg )
|
||||
|
||||
void pfConsole::IHandleKey( plKeyEventMsg *msg )
|
||||
{
|
||||
char *c, key;
|
||||
char *c;
|
||||
wchar_t key;
|
||||
int i,eol;
|
||||
static hsBool findAgain = false;
|
||||
static UInt32 findCounter = 0;
|
||||
@ -831,13 +832,13 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg )
|
||||
{
|
||||
key = plKeyboardDevice::KeyEventToChar( msg );
|
||||
// do they want to go into help mode?
|
||||
if( !fPythonMode && key == '?' && fWorkingCursor == 0 )
|
||||
if( !fPythonMode && key == L'?' && fWorkingCursor == 0 )
|
||||
{
|
||||
/// Go into help mode
|
||||
fHelpMode = true;
|
||||
}
|
||||
// do they want to go into Python mode?
|
||||
else if( !fHelpMode && key == '\\' && fWorkingCursor == 0 )
|
||||
else if( !fHelpMode && key == L'\\' && fWorkingCursor == 0 )
|
||||
{
|
||||
// toggle Python mode
|
||||
fPythonMode = fPythonMode ? false:true;
|
||||
|
@ -879,7 +879,7 @@ void pfGUIControlMod::Write( hsStream *s, hsResMgr *mgr )
|
||||
|
||||
//// HandleKeyPress/Event ////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIControlMod::HandleKeyPress( char key, UInt8 modifiers )
|
||||
hsBool pfGUIControlMod::HandleKeyPress( wchar_t key, UInt8 modifiers )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ class pfGUIControlMod : public plSingleModifier
|
||||
virtual void HandleMouseHover( hsPoint3 &mousePt, UInt8 modifiers ) {;}
|
||||
virtual void HandleMouseDblClick( hsPoint3 &mousePt, UInt8 modifiers ) {;}
|
||||
|
||||
virtual hsBool HandleKeyPress( char key, UInt8 modifiers );
|
||||
virtual hsBool HandleKeyPress( wchar_t key, UInt8 modifiers );
|
||||
virtual hsBool HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef key, UInt8 modifiers );
|
||||
|
||||
void SetHandler( pfGUICtrlProcObject *h ) { ISetHandler( h, true ); }
|
||||
|
@ -551,7 +551,7 @@ hsBool pfGUIDialogMod::HandleKeyEvent( pfGameGUIMgr::EventType event, plKey
|
||||
|
||||
//// HandleKeyPress //////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIDialogMod::HandleKeyPress( char key, UInt8 modifiers )
|
||||
hsBool pfGUIDialogMod::HandleKeyPress( wchar_t key, UInt8 modifiers )
|
||||
{
|
||||
// Same deal as HandleKeyPress. Only problem is, we needed the msg to translate
|
||||
// to a char, so it had to be done up at the mgr level (sadly)
|
||||
|
@ -119,7 +119,7 @@ class pfGUIDialogMod : public plSingleModifier
|
||||
|
||||
virtual hsBool HandleMouseEvent( pfGameGUIMgr::EventType event, hsScalar mouseX, hsScalar mouseY, UInt8 modifiers );
|
||||
hsBool HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef key, UInt8 modifiers );
|
||||
hsBool HandleKeyPress( char key, UInt8 modifiers );
|
||||
hsBool HandleKeyPress( wchar_t key, UInt8 modifiers );
|
||||
void UpdateInterestingThings( hsScalar mouseX, hsScalar mouseY, UInt8 modifiers, hsBool modalPreset );
|
||||
|
||||
void SetControlOfInterest( pfGUIControlMod *c );
|
||||
|
@ -277,10 +277,8 @@ void pfGUIEditBoxMod::HandleMouseDrag( hsPoint3 &mousePt, UInt8 modifiers )
|
||||
{
|
||||
}
|
||||
|
||||
hsBool pfGUIEditBoxMod::HandleKeyPress( char inKey, UInt8 modifiers )
|
||||
hsBool pfGUIEditBoxMod::HandleKeyPress( wchar_t key, UInt8 modifiers )
|
||||
{
|
||||
wchar_t key = (wchar_t)inKey;
|
||||
|
||||
if( fBuffer == nil )
|
||||
return false;
|
||||
|
||||
|
@ -90,7 +90,7 @@ class pfGUIEditBoxMod : public pfGUIControlMod
|
||||
virtual void HandleMouseUp( hsPoint3 &mousePt, UInt8 modifiers );
|
||||
virtual void HandleMouseDrag( hsPoint3 &mousePt, UInt8 modifiers );
|
||||
|
||||
virtual hsBool HandleKeyPress( char key, UInt8 modifiers );
|
||||
virtual hsBool HandleKeyPress( wchar_t key, UInt8 modifiers );
|
||||
virtual hsBool HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef key, UInt8 modifiers );
|
||||
|
||||
virtual void PurgeDynaTextMapImage();
|
||||
|
@ -905,7 +905,7 @@ void pfGUIListBoxMod::AddSelection( Int32 item )
|
||||
|
||||
//// HandleKeyPress //////////////////////////////////////////////////////////
|
||||
|
||||
hsBool pfGUIListBoxMod::HandleKeyPress( char key, UInt8 modifiers )
|
||||
hsBool pfGUIListBoxMod::HandleKeyPress( wchar_t key, UInt8 modifiers )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -133,7 +133,7 @@ class pfGUIListBoxMod : public pfGUIControlMod
|
||||
virtual void HandleMouseHover( hsPoint3 &mousePt, UInt8 modifiers );
|
||||
virtual void HandleMouseDblClick( hsPoint3 &mousePt, UInt8 modifiers );
|
||||
|
||||
virtual hsBool HandleKeyPress( char key, UInt8 modifiers );
|
||||
virtual hsBool HandleKeyPress( wchar_t key, UInt8 modifiers );
|
||||
virtual hsBool HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef key, UInt8 modifiers );
|
||||
|
||||
virtual hsBool FilterMousePosition( hsPoint3 &mousePt );
|
||||
|
@ -1072,10 +1072,8 @@ void pfGUIMultiLineEditCtrl::HandleMouseDrag( hsPoint3 &mousePt, UInt8 modifi
|
||||
IMoveCursorTo( IPointToPosition( (Int16)(mousePt.fX), (Int16)(mousePt.fY) ) );
|
||||
}
|
||||
|
||||
hsBool pfGUIMultiLineEditCtrl::HandleKeyPress( char keyIn, UInt8 modifiers )
|
||||
hsBool pfGUIMultiLineEditCtrl::HandleKeyPress( wchar_t key, UInt8 modifiers )
|
||||
{
|
||||
wchar_t key = (wchar_t)keyIn;
|
||||
|
||||
if ((fPrevCtrl || fNextCtrl) && (fLineStarts.GetCount() <= GetFirstVisibleLine()))
|
||||
return true; // we're ignoring if we can't actually edit our visible frame (and we're linked)
|
||||
|
||||
|
@ -195,7 +195,7 @@ class pfGUIMultiLineEditCtrl : public pfGUIControlMod
|
||||
virtual void HandleMouseUp( hsPoint3 &mousePt, UInt8 modifiers );
|
||||
virtual void HandleMouseDrag( hsPoint3 &mousePt, UInt8 modifiers );
|
||||
|
||||
virtual hsBool HandleKeyPress( char key, UInt8 modifiers );
|
||||
virtual hsBool HandleKeyPress( wchar_t key, UInt8 modifiers );
|
||||
virtual hsBool HandleKeyEvent( pfGameGUIMgr::EventType event, plKeyDef key, UInt8 modifiers );
|
||||
|
||||
virtual void PurgeDynaTextMapImage();
|
||||
|
@ -594,10 +594,13 @@ hsBool pfGameGUIMgr::IHandleKeyEvt( EventType event, plKeyDef key, UInt8 modifi
|
||||
// Like IHandleKeyPress, but takes in a char for distributing actual
|
||||
// characters typed.
|
||||
|
||||
hsBool pfGameGUIMgr::IHandleKeyPress( char key, UInt8 modifiers )
|
||||
hsBool pfGameGUIMgr::IHandleKeyPress( wchar_t key, UInt8 modifiers )
|
||||
{
|
||||
pfGUIDialogMod *dlg;
|
||||
|
||||
// Really... Don't handle any nil keypresses
|
||||
if (key == nil)
|
||||
return false;
|
||||
|
||||
for( dlg = fActiveDialogs; dlg != nil; dlg = dlg->GetNext() )
|
||||
{
|
||||
|
@ -153,7 +153,7 @@ class pfGameGUIMgr : public hsKeyedObject
|
||||
|
||||
hsBool IHandleMouse( EventType event, hsScalar mouseX, hsScalar mouseY, UInt8 modifiers, UInt32 *desiredCursor );
|
||||
hsBool IHandleKeyEvt( EventType event, plKeyDef key, UInt8 modifiers );
|
||||
hsBool IHandleKeyPress( char key, UInt8 modifiers );
|
||||
hsBool IHandleKeyPress( wchar_t key, UInt8 modifiers );
|
||||
|
||||
hsBool IModalBlocking( void );
|
||||
|
||||
|
@ -890,7 +890,7 @@ void plPythonFileMod::RemoveTarget(plSceneObject* so)
|
||||
void plPythonFileMod::HandleDiscardedKey( plKeyEventMsg *msg )
|
||||
{
|
||||
// So OnDefaultKeyCaught takes two parameters: the key character pressed and a boolean saying up or down
|
||||
char keyChar = plKeyboardDevice::KeyEventToChar( msg );
|
||||
wchar_t keyChar = plKeyboardDevice::KeyEventToChar( msg );
|
||||
|
||||
// if the caps lock is down then reverse upper and lowercase
|
||||
if ( msg->GetCapsLockKeyDown() )
|
||||
|
Reference in New Issue
Block a user