3 #include <msp/graphics/window_private.h>
5 #include "keys_private.h"
7 #ifndef MAPVK_VK_TO_VSC
8 #define MAPVK_VK_TO_VSC 0
14 std::string Keyboard::get_button_name(unsigned btn) const
19 unsigned vkey = key_to_sys(btn);
20 unsigned scan = MapVirtualKey(vkey&0xFF, MAPVK_VK_TO_VSC);
24 if(!GetKeyNameText(scan<<16, buf, sizeof(buf)))
25 return Device::get_button_name(btn);
30 void Keyboard::input_event(const Graphics::Window::Event &event)
39 unsigned key = event.wparam | ((event.lparam>>16)&0x100);
42 if(((event.lparam>>16)&0xFF)==MapVirtualKey(VK_RSHIFT, MAPVK_VK_TO_VSC))
47 set_button_state(key_from_sys(key), false, true);
48 if(event.msg==WM_KEYDOWN || event.msg==WM_SYSKEYDOWN)
49 set_button_state(key_from_sys(key), true, true);
53 signal_character.emit(event.wparam);