diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-25 16:07:02 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-07-25 16:07:02 (GMT) |
commit | fda72faf1d67dd4016bf6842a6448943bd324707 (patch) | |
tree | b548a211106c683957d4631e5229f7fb1e3625b4 /generic/tkEvent.c | |
parent | 5c07a1409bb742e9fe41e7e523146ce75d71580a (diff) | |
parent | 02adf45068f997e84707a3479e629b74b5409671 (diff) | |
download | tk-fda72faf1d67dd4016bf6842a6448943bd324707.zip tk-fda72faf1d67dd4016bf6842a6448943bd324707.tar.gz tk-fda72faf1d67dd4016bf6842a6448943bd324707.tar.bz2 |
Experiment: Handle scaling fractors for the ScrollWheel sensibly. Trying "40" as a good general scale factor (compared to "50" on X11 and "120" on Win32 and "1" on Aqua)
Diffstat (limited to 'generic/tkEvent.c')
-rw-r--r-- | generic/tkEvent.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/generic/tkEvent.c b/generic/tkEvent.c index e94cdd5..dd77c2b 100644 --- a/generic/tkEvent.c +++ b/generic/tkEvent.c @@ -527,8 +527,8 @@ RefreshKeyboardMappingIfNeeded( * * Return the proper Button${n}Mask for the button. Don't care about * Button4 - Button7, because those are not actually buttons: Those - * are used for the horizontal or vertical mouse wheels. The - * Button4Mask/Button5Mask's are actually used for Button 8 and 9. + * are used for the horizontal or vertical mouse wheels. Button4Mask + * and higher is actually used for Button 8 and higher. * * Results: * A button mask. @@ -539,11 +539,12 @@ RefreshKeyboardMappingIfNeeded( *---------------------------------------------------------------------- */ -static const int buttonMasks[] = { - 0, Button1Mask, Button2Mask, Button3Mask, 0, 0, 0, 0, Button4Mask, Button5Mask +static const unsigned int buttonMasks[] = { + 0, Button1Mask, Button2Mask, Button3Mask, 0, 0, 0, 0, Button4Mask, \ + Button5Mask, Button6Mask, Button7Mask, Button8Mask, Button9Mask }; -int +unsigned int TkGetButtonMask( unsigned int button) { @@ -593,7 +594,7 @@ UpdateButtonEventState( #if defined(_WIN32) || defined(MAC_OSX_TK) eventPtr->xkey.nbytes = 0; #endif - eventPtr->xkey.keycode = (eventPtr->xbutton.button & 1) ? 1 : -1; + eventPtr->xkey.keycode = (eventPtr->xbutton.button & 1) ? 40 : -40; if (eventPtr->xkey.keycode > Button5) { eventPtr->xkey.state |= ShiftMask; } |