GNOME Bugzilla – Bug 143240
Keyboard modifier state not sent in tablet (extended input device) events on win32
Last modified: 2004-12-22 21:47:04 UTC
The button and motion events sent by the win32 tablet code in gdk/win32/gdkinput-win32.c (_gdk_input_other_event) do not contain the state of the keyboard modifier keys (shift, ctrl etc) in the state field of the events. This causes trouble when using a tablet with The GIMP 2.0. In particular, while using the pen or brush tool and holding down the shift key to draw straight lines, The GIMP constantly switches between normal mode and line mode because the motion events sent by the tablet do not contain the GDK_SHIFT_MASK bit in the state field. This applies to the gtk-2-4 branch with my patch from bug #143237 applied, using a Wacom Graphire 3 USB tablet on Windows XP. A suggested patch that fixes this will be attached shortly.
Created attachment 28051 [details] [review] Patch to send key modifiers in tablet button and motion events I created a new little helper function to get the state of only the keyboard modifiers. One could call gdk_window_get_pointer (window, NULL, NULL, mods) to get the modifiers but that function does a lot of unneccesary things and since the tablet event code is called often (50-100 motion events/second usually) I did not want to use it. If there are other better ways of getting this information please tell me. Note: The patch from bug #143237 should probably be applied first, as I have only tested this patch after applying that. This patch is not created using cvs diff, apply with patch -p1 < gtk-gdk-wintab-keymod.patch in the gtk+/ directory.
Patch applied to HEAD and gtk-2-4.