Event System: click/click-drag support for NDOF buttons

Support this for completeness, as it's simpler to support click-drag
for all events types that support press/release instead of having to
document which kinds buttons support click-drag.
This commit is contained in:
Campbell Barton 2022-03-08 13:48:40 +11:00
parent f052fb5646
commit b58e660828
2 changed files with 6 additions and 1 deletions

View File

@ -5142,11 +5142,15 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void
case GHOST_kRelease:
event.val = KM_RELEASE;
break;
default:
BLI_assert_unreachable();
}
event.custom = 0;
event.customdata = NULL;
wm_event_state_update_and_click_set(&event, event_state);
wm_event_add(win, &event);
break;

View File

@ -371,7 +371,8 @@ enum {
* \note Mouse wheel events are excluded from this macro, while they do generate press events it
* doesn't make sense to have click & click-drag events for a mouse-wheel as it can't be held down.
*/
#define ISKEYBOARD_OR_BUTTON(event_type) (ISMOUSE_BUTTON(event_type) || ISKEYBOARD(event_type))
#define ISKEYBOARD_OR_BUTTON(event_type) \
(ISMOUSE_BUTTON(event_type) || ISKEYBOARD(event_type) || ISNDOF_BUTTON(event_type))
/** Test whether the event is a modifier key. */
#define ISKEYMODIFIER(event_type) \