diff options
author | StapleButter <thetotalworm@gmail.com> | 2017-09-17 23:25:32 +0200 |
---|---|---|
committer | StapleButter <thetotalworm@gmail.com> | 2017-09-17 23:25:32 +0200 |
commit | 8e7d46e717cc189681608adceeec84bb483b8f70 (patch) | |
tree | f30035614b45c07c0d30b21bca920b48b320ef76 /src/libui_sdl/libui/windows/areaevents.cpp | |
parent | 66106a882954385e460bfbb3fb3422e13c45b4ba (diff) |
* attempt at keyboard input, via raw scancodes
* load config, etc
* some things are nicer, too
Diffstat (limited to 'src/libui_sdl/libui/windows/areaevents.cpp')
-rw-r--r-- | src/libui_sdl/libui/windows/areaevents.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libui_sdl/libui/windows/areaevents.cpp b/src/libui_sdl/libui/windows/areaevents.cpp index 7d391b8..842f2d7 100644 --- a/src/libui_sdl/libui/windows/areaevents.cpp +++ b/src/libui_sdl/libui/windows/areaevents.cpp @@ -262,8 +262,14 @@ static int areaKeyEvent(uiArea *a, int up, WPARAM wParam, LPARAM lParam) ke.Modifiers = getModifiers(); + ke.Scancode = (lParam >> 16) & 0x1FF; + ke.Up = up; + ke.Repeat = (lParam & 0x40000000) ? 1:0; + // StapleButter note: I don't actually need all this key decoding + // raw scancodes are all I need for this +#if 0 // the numeric keypad keys when Num Lock is off are considered left-hand keys as the separate navigation buttons were added later // the numeric keypad Enter, however, is a right-hand key because it has the same virtual-key code as the typewriter Enter righthand = (lParam & 0x01000000) != 0; @@ -306,9 +312,17 @@ static int areaKeyEvent(uiArea *a, int up, WPARAM wParam, LPARAM lParam) return 0; keyFound: +#endif return (*(a->ah->KeyEvent))(a->ah, a, &ke); } +char* uiKeyName(int scancode) +{ + WCHAR tmp[64]; + GetKeyNameText(scancode<<16, tmp, 64); + return toUTF8(tmp); +} + // We don't handle the standard Windows keyboard messages directly, to avoid both the dialog manager and TranslateMessage(). // Instead, we set up a message filter and do things there. // That stuff is later in this file. |