[Bf-blender-cvs] [1979ae3] master: Events: Fix ISKEYBOARD macro seeing INPUTCHANGE, WINDEACTIVATE and TIMER events as keyboard ones!!!

Bastien Montagne noreply at git.blender.org
Mon Sep 1 17:21:12 CEST 2014


Commit: 1979ae3a420b98663c37ab3f377b5d7dc265e33d
Author: Bastien Montagne
Date:   Mon Sep 1 17:18:30 2014 +0200
Branches: master
https://developer.blender.org/rB1979ae3a420b98663c37ab3f377b5d7dc265e33d

Events: Fix ISKEYBOARD macro seeing INPUTCHANGE, WINDEACTIVATE and TIMER events
as keyboard ones!!!

Note: better solution would be to move those 'internal' events to the 0x5xxx area,
but need to talk with the team to be sure this won't break something first.

===================================================================

M	source/blender/windowmanager/wm_event_types.h

===================================================================

diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index d7335cc..2a1504b 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -89,7 +89,7 @@ enum {
 	/* *** Start of keyboard codes. *** */
 
 	/* standard keyboard.
-	 * XXX from 0x0020 to 0x00ff, and 0x012c to 0x0140 for function keys! */
+	 * XXX from 0x0020 to 0x00ff, and 0x012c to 0x013f for function keys! */
 	AKEY            = 0x0061,  /* 'a' */
 	BKEY            = 0x0062,  /* 'b' */
 	CKEY            = 0x0063,  /* 'c' */
@@ -327,7 +327,9 @@ enum {
 /* note, an alternative could be to check 'event->utf8_buf' */
 
 /* test whether the event is a key on the keyboard */
-#define ISKEYBOARD(event_type)  (event_type >= ' ' && event_type <= 320)
+#define ISKEYBOARD(event_type)                          \
+	((event_type >= 0x0020 && event_type <= 0x00ff) ||  \
+	 (event_type >= 0x012c && event_type <= 0x013f))
 
 /* test whether the event is a modifier key */
 #define ISKEYMODIFIER(event_type)  ((event_type >= LEFTCTRLKEY && event_type <= LEFTSHIFTKEY) || event_type == OSKEY)




More information about the Bf-blender-cvs mailing list