Commit ba7ee227 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist

gdk/win32/gdkevents-win32.c gdk/win32/gdkkeys-win32.c Check the

2005-05-18  Tor Lillqvist  <tml@novell.com>

	* gdk/win32/gdkevents-win32.c
	* gdk/win32/gdkkeys-win32.c
	* gdk/win32/gdkprivate-win32.h: Check the KF_EXTENDED bit in
	lParam of WM_KEY* messages to distinguish between left and right
	Control and Alt keys. Unfortunately, the right Shift key doesnt
	set KF_EXTENDED, so to distinguish between left and right Shift
	keys, check the scan code. (#304584)
parent f6906b82
2005-05-18 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkevents-win32.c
* gdk/win32/gdkkeys-win32.c
* gdk/win32/gdkprivate-win32.h: Check the KF_EXTENDED bit in
lParam of WM_KEY* messages to distinguish between left and right
Control and Alt keys. Unfortunately, the right Shift key doesnt
set KF_EXTENDED, so to distinguish between left and right Shift
keys, check the scan code. (#304584)
2005-05-18 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkproperty-x11.c (gdk_property_get): Warn if
......
2005-05-18 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkevents-win32.c
* gdk/win32/gdkkeys-win32.c
* gdk/win32/gdkprivate-win32.h: Check the KF_EXTENDED bit in
lParam of WM_KEY* messages to distinguish between left and right
Control and Alt keys. Unfortunately, the right Shift key doesnt
set KF_EXTENDED, so to distinguish between left and right Shift
keys, check the scan code. (#304584)
2005-05-18 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkproperty-x11.c (gdk_property_get): Warn if
......
2005-05-18 Tor Lillqvist <tml@novell.com>
* gdk/win32/gdkevents-win32.c
* gdk/win32/gdkkeys-win32.c
* gdk/win32/gdkprivate-win32.h: Check the KF_EXTENDED bit in
lParam of WM_KEY* messages to distinguish between left and right
Control and Alt keys. Unfortunately, the right Shift key doesnt
set KF_EXTENDED, so to distinguish between left and right Shift
keys, check the scan code. (#304584)
2005-05-18 Matthias Clasen <mclasen@redhat.com>
* gdk/x11/gdkproperty-x11.c (gdk_property_get): Warn if
......
......@@ -2438,6 +2438,26 @@ gdk_event_translate (GdkDisplay *display,
event->key.string = NULL;
event->key.length = 0;
event->key.hardware_keycode = msg->wParam;
if (HIWORD (msg->lParam) & KF_EXTENDED)
{
switch (msg->wParam)
{
case VK_CONTROL:
event->key.hardware_keycode = VK_RCONTROL;
break;
case VK_SHIFT: /* Actually, KF_EXTENDED is not set
* for the right shift key.
*/
event->key.hardware_keycode = VK_RSHIFT;
break;
case VK_MENU:
event->key.hardware_keycode = VK_RMENU;
break;
}
}
else if (msg->wParam == VK_SHIFT &&
LOBYTE (HIWORD (msg->lParam)) == _scancode_rshift)
event->key.hardware_keycode = VK_RSHIFT;
API_CALL (GetKeyboardState, (key_state));
......
......@@ -40,6 +40,8 @@
guint _gdk_keymap_serial = 0;
gboolean _gdk_keyboard_has_altgr = FALSE;
guint _scancode_rshift = 0;
static GdkModifierType gdk_shift_modifiers = GDK_SHIFT_MASK;
static GdkKeymap *default_keymap = NULL;
......@@ -357,6 +359,9 @@ update_keymap (void)
{
gint shift;
if (vk == VK_RSHIFT)
_scancode_rshift = scancode;
key_state[vk] = 0x80;
for (shift = 0; shift < 4; shift++)
{
......
......@@ -465,6 +465,7 @@ extern UINT _gdk_input_codepage;
extern guint _gdk_keymap_serial;
extern gboolean _gdk_keyboard_has_altgr;
extern guint _scancode_rshift;
/* Registered clipboard formats */
extern WORD _cf_rtf;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment