diff options
author | James Ross-Gowan <rossymiles@gmail.com> | 2017-04-24 22:00:20 +1000 |
---|---|---|
committer | James Ross-Gowan <rossymiles@gmail.com> | 2017-05-12 22:58:58 +1000 |
commit | cc6922cf060e2ea619914a2ac3aa679760368bbf (patch) | |
tree | 38185bc095580c93083fd130fc06061b0cb8f79a /input | |
parent | 2b616c0682a894152b06ef7249b32ef17037b3e5 (diff) | |
download | mpv-cc6922cf060e2ea619914a2ac3aa679760368bbf.tar.bz2 mpv-cc6922cf060e2ea619914a2ac3aa679760368bbf.tar.xz |
input: add MP_KEY_IS_AXIS and treat MP_AXIS_* as mouse events
MP_AXIS_* events are semantically equivalent to scroll button events
(eg. MP_MOUSE_BTN{3,4,5,6}). They depend on the mouse position.
Diffstat (limited to 'input')
-rw-r--r-- | input/keycodes.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/input/keycodes.h b/input/keycodes.h index da88d52c37..faf8c811cb 100644 --- a/input/keycodes.h +++ b/input/keycodes.h @@ -172,6 +172,10 @@ #define MP_AXIS_DOWN (MP_AXIS_BASE+1) #define MP_AXIS_LEFT (MP_AXIS_BASE+2) #define MP_AXIS_RIGHT (MP_AXIS_BASE+3) +#define MP_AXIS_END (MP_AXIS_BASE+4) + +#define MP_KEY_IS_AXIS(code) \ + ((code) >= MP_AXIS_BASE && (code) < MP_AXIS_END) // Reserved area. Can be used for keys that have no explicit names assigned, // but should be mappable by the user anyway. @@ -195,10 +199,12 @@ // Whether to dispatch the key binding by current mouse position. #define MP_KEY_DEPENDS_ON_MOUSE_POS(code) \ - (MP_KEY_IS_MOUSE_CLICK(code) || (code) == MP_KEY_MOUSE_MOVE) + (MP_KEY_IS_MOUSE_CLICK(code) || MP_KEY_IS_AXIS(code) || \ + (code) == MP_KEY_MOUSE_MOVE) #define MP_KEY_IS_MOUSE(code) \ - (MP_KEY_IS_MOUSE_CLICK(code) || MP_KEY_IS_MOUSE_MOVE(code)) + (MP_KEY_IS_MOUSE_CLICK(code) || MP_KEY_IS_AXIS(code) || \ + MP_KEY_IS_MOUSE_MOVE(code)) // No input source should generate this. #define MP_KEY_UNMAPPED (MP_KEY_INTERN+4) |