if(btn==KEY_NONE)
return "None";
+ unsigned vkey = key_to_sys(btn);
+ unsigned scan = MapVirtualKey(vkey&0xFF, MAPVK_VK_TO_VSC);
+ scan |= vkey&0x100;
+
char buf[128];
- unsigned scan = MapVirtualKey(key_to_sys(btn), MAPVK_VK_TO_VSC);
if(!GetKeyNameText(scan<<16, buf, sizeof(buf)))
return Device::get_button_name(btn);
+
return buf;
}
{
case WM_KEYDOWN:
case WM_KEYUP:
- set_button_state(key_from_sys(event.wparam), event.msg==WM_KEYDOWN, true);
+ {
+ unsigned key = event.wparam | ((event.lparam>>16)&0x100);
+ if(key==VK_SHIFT)
+ {
+ if(((event.lparam>>16)&0xFF)==MapVirtualKey(VK_RSHIFT, MAPVK_VK_TO_VSC))
+ key = VK_RSHIFT;
+ else
+ key = VK_LSHIFT;
+ }
+ set_button_state(key_from_sys(key), event.msg==WM_KEYDOWN, true);
+ }
break;
case WM_CHAR:
signal_character.emit(event.wparam);
0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,
- VK_LEFT, VK_RIGHT, VK_UP, VK_DOWN, 0, 0, 0, 0,
- VK_HOME, VK_END, VK_PRIOR, VK_NEXT, VK_INSERT, VK_DELETE, 0, 0,
+ VK_LEFT|0x100, VK_RIGHT|0x100, VK_UP|0x100, VK_DOWN|0x100, 0, 0, 0, 0,
+ VK_HOME|0x100, VK_END|0x100, VK_PRIOR|0x100, VK_NEXT|0x100, VK_INSERT|0x100, VK_DELETE|0x100, 0, 0,
0, VK_F1, VK_F2, VK_F3, VK_F4, VK_F5, VK_F6, VK_F7,
VK_F8, VK_F9, VK_F10, VK_F11, VK_F12, 0, 0, 0,
- VK_LSHIFT, VK_RSHIFT, VK_LCONTROL, VK_RCONTROL, 0, 0, VK_LWIN, VK_RWIN,
- VK_CAPITAL, VK_SCROLL, VK_NUMLOCK, 0, 0, 0, 0, 0,
+ VK_LSHIFT, VK_RSHIFT, VK_CONTROL, VK_CONTROL|0x100, 0, 0, VK_LWIN, VK_RWIN,
+ VK_CAPITAL, VK_SCROLL, VK_NUMLOCK|0x100, 0, 0, 0, 0, 0,
VK_NUMPAD0, VK_NUMPAD1, VK_NUMPAD2, VK_NUMPAD3, VK_NUMPAD4, VK_NUMPAD5, VK_NUMPAD6, VK_NUMPAD7,
- VK_NUMPAD8, VK_NUMPAD9, VK_ADD, VK_SUBTRACT, VK_MULTIPLY, VK_DIVIDE, VK_SEPARATOR, 0,
+ VK_NUMPAD8, VK_NUMPAD9, VK_ADD, VK_SUBTRACT, VK_MULTIPLY, VK_DIVIDE|0x100, VK_SEPARATOR, 0,
VK_PAUSE, VK_SNAPSHOT, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0,