Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-03-08 05:48:32 +0300
committerCampbell Barton <campbell@blender.org>2022-03-08 05:48:32 +0300
commit08f88bba6937f965e1d0d0c2f2e37dfbc25b29a5 (patch)
treea8deb4c0bee699c83cdb7ea9cc88a673c7620ae6 /source/blender/windowmanager
parent7b663976645973f15b243c101497626c590c2cde (diff)
Event System: exclude cursor & NDOF motion from ISHOTKEY() macro
In practice this didn't cause a bug since assigning hot-keys was also checking for "press" events (which NDOF_MOTION doesn't generate). Add ISNDOF_BUTTON macro which is now used by ISHOTKEY to avoid problems in the future.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/wm_event_types.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index d5c8c5022cc..578663b6fe8 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -244,6 +244,7 @@ enum {
NDOF_MOTION = 0x0190, /* 400 */
#define _NDOF_MIN NDOF_MOTION
+#define _NDOF_BUTTON_MIN NDOF_BUTTON_MENU
/* used internally, never sent */
NDOF_BUTTON_NONE = NDOF_MOTION,
@@ -296,6 +297,7 @@ enum {
NDOF_BUTTON_C = 0x01b6, /* 438 */
#define _NDOF_MAX NDOF_BUTTON_C
+#define _NDOF_BUTTON_MAX NDOF_BUTTON_C
/* ********** End of Input devices. ********** */
@@ -386,13 +388,16 @@ enum {
/** Test whether the event is a NDOF event. */
#define ISNDOF(event_type) ((event_type) >= _NDOF_MIN && (event_type) <= _NDOF_MAX)
+#define ISNDOF_BUTTON(event_type) \
+ ((event_type) >= _NDOF_BUTTON_MIN && (event_type) <= _NDOF_BUTTON_MAX)
#define IS_EVENT_ACTIONZONE(event_type) \
ELEM(event_type, EVT_ACTIONZONE_AREA, EVT_ACTIONZONE_REGION, EVT_ACTIONZONE_FULLSCREEN)
/** Test whether event type is acceptable as hotkey (excluding modifiers). */
#define ISHOTKEY(event_type) \
- ((ISKEYBOARD(event_type) || ISMOUSE(event_type) || ISNDOF(event_type)) && \
+ ((ISKEYBOARD(event_type) || ISMOUSE_BUTTON(event_type) || ISMOUSE_WHEEL(event_type) || \
+ ISNDOF_BUTTON(event_type)) && \
(ISKEYMODIFIER(event_type) == false))
enum eEventType_Mask {