diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-01-11 17:38:44 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-01-11 17:40:23 +0400 |
commit | 50650e28ea5641b200727fcbe14de83fa10e2c49 (patch) | |
tree | 8ae157905baa7f0677d90b467ec8a9fb9c746076 /intern/ghost | |
parent | 1a0c5eb83aaaf18cef25d6d36a2c857c1381516c (diff) |
Events: support for buttons 6 & 7 (some trackballs have these) X11 only
Patch by Marcus von Appen
Note: this patch makes ISMOUSE accept INBETWEEN_MOUSEMOVE as a mouse
event where before it didnt.
Diffstat (limited to 'intern/ghost')
-rw-r--r-- | intern/ghost/GHOST_Types.h | 3 | ||||
-rw-r--r-- | intern/ghost/intern/GHOST_SystemX11.cpp | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/intern/ghost/GHOST_Types.h b/intern/ghost/GHOST_Types.h index 35dff73f4af..7333ba025a5 100644 --- a/intern/ghost/GHOST_Types.h +++ b/intern/ghost/GHOST_Types.h @@ -148,6 +148,9 @@ typedef enum { GHOST_kButtonMaskRight, GHOST_kButtonMaskButton4, GHOST_kButtonMaskButton5, + /* Trackballs and programmable buttons */ + GHOST_kButtonMaskButton6, + GHOST_kButtonMaskButton7, GHOST_kButtonNumMasks } GHOST_TButtonMask; diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp index 0746dd8f14a..3b12d917ced 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cpp +++ b/intern/ghost/intern/GHOST_SystemX11.cpp @@ -902,6 +902,10 @@ GHOST_SystemX11::processEvent(XEvent *xe) * you can re-order button mapping like this... (swaps 6,7 with 8,9) * xmodmap -e "pointer = 1 2 3 4 5 8 9 6 7" */ + else if (xbe.button == 6) + gbmask = GHOST_kButtonMaskButton6; + else if (xbe.button == 7) + gbmask = GHOST_kButtonMaskButton7; else if (xbe.button == 8) gbmask = GHOST_kButtonMaskButton4; else if (xbe.button == 9) |