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)
This commit is contained in:
Tor Lillqvist 2005-05-18 14:53:00 +00:00 committed by Tor Lillqvist
parent f6906b8272
commit ba7ee2270a
6 changed files with 56 additions and 0 deletions

View File

@ -1,3 +1,13 @@
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

View File

@ -1,3 +1,13 @@
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

View File

@ -1,3 +1,13 @@
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

View File

@ -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));

View File

@ -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++)
{

View File

@ -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;