diff options
author | Andrea Weikert <elubie@gmx.net> | 2012-10-31 01:06:25 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2012-10-31 01:06:25 +0400 |
commit | 6ae77bed7a59a8643bf444270ef76c873c07bd79 (patch) | |
tree | ecb3d2a096f4c1712d66439447505b78ea315c8e /source/blender/windowmanager | |
parent | 700f39ab466a8db734fc04fa346c2d3f99a20956 (diff) |
fix [#30479] Exclamation mark '!' doesn't input with AZERTY keyboard mapping
For the french keyboard setting (AZERTY) on Windows, the '!' came back with winevent->type=312, winevent->ascii='!' and the ISTEXTINPUT only matched key codes up to 255. Now replaces with
ISKEYBOARD in wm_eventmatch.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 10 | ||||
-rw-r--r-- | source/blender/windowmanager/wm_event_types.h | 3 |
2 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index 811587e30a6..031deb1f010 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -1331,8 +1331,12 @@ static int wm_eventmatch(wmEvent *winevent, wmKeyMapItem *kmi) /* the matching rules */ if (kmitype == KM_TEXTINPUT) - if (winevent->val == KM_PRESS) // prevent double clicks - if (ISTEXTINPUT(winevent->type) && (winevent->ascii || winevent->utf8_buf[0])) return 1; + if (winevent->val == KM_PRESS) { // prevent double clicks + /* NOT using ISTEXTINPUT anymore because (at least on Windows) some key codes above 255 + could have printable ascii keys - BUG [#30479] */ + if (ISKEYBOARD(winevent->type) && (winevent->ascii || winevent->utf8_buf[0])) return 1; + } + if (kmitype != KM_ANY) if (winevent->type != kmitype) return 0; @@ -1355,7 +1359,7 @@ static int wm_eventmatch(wmEvent *winevent, wmKeyMapItem *kmi) /* key modifiers always check when event has it */ /* otherwise regular keypresses with keymodifier still work */ if (winevent->keymodifier) - if (ISTEXTINPUT(winevent->type)) + if (ISKEYBOARD(winevent->type)) // was ISTEXTINPUT - BUG [#30479] if (winevent->keymodifier != kmi->keymodifier) return 0; return 1; diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h index 95a8a7db635..ca0e9659a22 100644 --- a/source/blender/windowmanager/wm_event_types.h +++ b/source/blender/windowmanager/wm_event_types.h @@ -285,8 +285,9 @@ enum { /* for event checks */ /* only used for KM_TEXTINPUT, so assume that we want all user-inputtable ascii codes included */ + /* UNUSED - see wm_eventmatch - BUG [#30479] #define ISTEXTINPUT(event) (event >= ' ' && event <= 255) - + */ /* test whether the event is a key on the keyboard */ #define ISKEYBOARD(event) (event >= ' ' && event <= 320) |