diff options
author | Tor Lillqvist <tml@src.gnome.org> | 1999-08-12 21:44:22 +0000 |
---|---|---|
committer | Tor Lillqvist <tml@src.gnome.org> | 1999-08-12 21:44:22 +0000 |
commit | 60fbf3800b1688a7e88a2b055a0114fe3c8b7089 (patch) | |
tree | d55f5544bd028915c9c0740866a7bf7bc54dba3e /gdk/win32/gdkevents.c | |
parent | fa53582fef98fed776f3e4f3b700057fa50e5f56 (diff) | |
download | gdk-pixbuf-60fbf3800b1688a7e88a2b055a0114fe3c8b7089.tar.gz |
Fix a couple of bugs in the key event handling: Now AltGr chars work
* gdk/win32/gdkevents.c (gdk_event_translate): Fix a couple of bugs
in the key event handling: Now AltGr chars work again. Also,
now Alt-digits are passed up as well as Control-digits.
Pass keypad plus and minus as normal plus and minus.
Diffstat (limited to 'gdk/win32/gdkevents.c')
-rw-r--r-- | gdk/win32/gdkevents.c | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/gdk/win32/gdkevents.c b/gdk/win32/gdkevents.c index d4b5a4846..efe2a29db 100644 --- a/gdk/win32/gdkevents.c +++ b/gdk/win32/gdkevents.c @@ -1488,11 +1488,23 @@ gdk_event_translate (GdkEvent *event, case VK_MULTIPLY: event->key.keyval = GDK_KP_Multiply; break; case VK_ADD: +#if 0 event->key.keyval = GDK_KP_Add; break; +#else + /* Pass it on as an ASCII plus in WM_CHAR. */ + ignore_WM_CHAR = FALSE; + break; +#endif case VK_SEPARATOR: event->key.keyval = GDK_KP_Separator; break; case VK_SUBTRACT: +#if 0 event->key.keyval = GDK_KP_Subtract; break; +#else + /* Pass it on as an ASCII minus in WM_CHAR. */ + ignore_WM_CHAR = FALSE; + break; +#endif case VK_DECIMAL: #if 0 event->key.keyval = GDK_KP_Decimal; break; @@ -1548,8 +1560,9 @@ gdk_event_translate (GdkEvent *event, case '7': case '8': case '9': - if (GetKeyState (VK_CONTROL) < 0) - /* Control-digits won't come in as a WM_CHAR */ + if (!is_AltGr_key && (GetKeyState (VK_CONTROL) < 0 + || GetKeyState (VK_MENU) < 0)) + /* Control- or Alt-digits won't come in as a WM_CHAR */ event->key.keyval = GDK_0 + (xevent->wParam - '0'); else { @@ -1744,7 +1757,12 @@ gdk_event_translate (GdkEvent *event, } else return_val = FALSE; +#if 0 /* Don't reset is_AltGr_key here. Othewise we can't type several + * AltGr-accessed chars while keeping the AltGr pressed down + * all the time. + */ is_AltGr_key = FALSE; +#endif break; case WM_LBUTTONDOWN: |