one of these days, I'd like for Caps Lock to work...

This commit is contained in:
AJ Kelly
2011-01-09 18:00:47 -06:00
parent 28084a1609
commit 101711b965
4 changed files with 46 additions and 44 deletions
+4 -7
View File
@@ -1,7 +1,5 @@
/* /* Define all of the input devices we know about. This is the public interface
* Define all of the input devices we know about. This is the public * for describing input devices. */
* interface for describing input devices.
*/
#include "global.h" #include "global.h"
#include "RageInputDevice.h" #include "RageInputDevice.h"
@@ -106,7 +104,7 @@ static void InitNames()
g_mapNamesToString[JOY_UP] = "Up1"; g_mapNamesToString[JOY_UP] = "Up1";
g_mapNamesToString[JOY_DOWN] = "Down1"; g_mapNamesToString[JOY_DOWN] = "Down1";
/* Secondary sticks: */ // Secondary sticks:
g_mapNamesToString[JOY_LEFT_2] = "Left2"; g_mapNamesToString[JOY_LEFT_2] = "Left2";
g_mapNamesToString[JOY_RIGHT_2] = "Right2"; g_mapNamesToString[JOY_RIGHT_2] = "Right2";
g_mapNamesToString[JOY_UP_2] = "Up2"; g_mapNamesToString[JOY_UP_2] = "Up2";
@@ -149,7 +147,7 @@ RString DeviceButtonToString( DeviceButton key )
{ {
InitNames(); InitNames();
/* All printable ASCII except for uppercase alpha characters line up. */ // All printable ASCII except for uppercase alpha characters line up.
if( key >= 33 && key < 127 && if( key >= 33 && key < 127 &&
!(key >= 'A' && key <= 'Z' ) ) !(key >= 'A' && key <= 'Z' ) )
return ssprintf( "%c", key ); return ssprintf( "%c", key );
@@ -194,7 +192,6 @@ DeviceButton StringToDeviceButton( const RString& s )
return DeviceButton_Invalid; return DeviceButton_Invalid;
} }
static const char *InputDeviceNames[] = { static const char *InputDeviceNames[] = {
"Key", "Key",
"Joy1", "Joy1",
+2
View File
@@ -69,6 +69,8 @@ wchar_t InputHandler::DeviceButtonToChar( DeviceButton button, bool bUseCurrentK
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL)) || INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_LCTRL)) ||
INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL)); INPUTFILTER->IsBeingPressed(DeviceInput(DEVICE_KEYBOARD, KEY_RCTRL));
// todo: handle Caps Lock -freem
if( bHoldingShift && !bHoldingCtrl ) if( bHoldingShift && !bHoldingCtrl )
{ {
MakeUpper( &c, 1 ); MakeUpper( &c, 1 );
@@ -733,6 +733,7 @@ wchar_t InputHandler_DInput::DeviceButtonToChar( DeviceButton button, bool bUseC
ZERO( keys ); ZERO( keys );
if( bUseCurrentKeyModifiers ) if( bUseCurrentKeyModifiers )
GetKeyboardState(keys); GetKeyboardState(keys);
// todo: handle Caps Lock -freem
wchar_t c = ScancodeAndKeysToChar( i->ofs, keys ); wchar_t c = ScancodeAndKeysToChar( i->ofs, keys );
if( c ) if( c )
return c; return c;
@@ -394,6 +394,8 @@ wchar_t InputHandler_MacOSX_HID::DeviceButtonToChar( DeviceButton button, bool b
if( bUseCurrentKeyModifiers ) if( bUseCurrentKeyModifiers )
modifiers = GetCurrentKeyModifiers(); modifiers = GetCurrentKeyModifiers();
// todo: handle Caps Lock -freem
SInt16 iCurrentKeyScript = GetScriptManagerVariable( smKeyScript ); SInt16 iCurrentKeyScript = GetScriptManagerVariable( smKeyScript );
SInt16 iCurrentKeyLayoutID = GetScriptVariable( iCurrentKeyScript, smScriptKeys ); SInt16 iCurrentKeyLayoutID = GetScriptVariable( iCurrentKeyScript, smScriptKeys );
static SInt16 iLastKeyLayoutID = !iCurrentKeyLayoutID; // Just be different. static SInt16 iLastKeyLayoutID = !iCurrentKeyLayoutID; // Just be different.