aboutsummaryrefslogtreecommitdiffhomepage
path: root/player
diff options
context:
space:
mode:
authorGravatar Ricardo Constantino <wiiaboo@gmail.com>2017-04-15 18:08:08 +0100
committerGravatar Ricardo Constantino <wiiaboo@gmail.com>2017-04-19 20:18:23 +0100
commit00ab5a15be3421575fb8c9821880c62509e10746 (patch)
tree3e4384923f1a9511b53f12b69416de66dfc5b784 /player
parente870b7ad666d776eb3bc4fee93fb3c654dd3bba1 (diff)
osc: support handling mouse wheel events
Diffstat (limited to 'player')
-rw-r--r--player/lua/osc.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/player/lua/osc.lua b/player/lua/osc.lua
index fe51c511e1..e11be212db 100644
--- a/player/lua/osc.lua
+++ b/player/lua/osc.lua
@@ -2054,7 +2054,7 @@ function process_event(source, what)
local action = string.format("%s%s", source,
what and ("_" .. what) or "")
- if what == "down" then
+ if what == "down" or what == "press" then
for n = 1, #elements do
@@ -2063,9 +2063,11 @@ function process_event(source, what)
(elements[n].eventresponder[source .. "_up"] or
elements[n].eventresponder[action]) then
- state.active_element = n
- state.active_event_source = source
- -- fire the down event if the element has one
+ if what == "down" then
+ state.active_element = n
+ state.active_event_source = source
+ end
+ -- fire the down or press event if the element has one
if element_has_action(elements[n], action) then
elements[n].eventresponder[action](elements[n])
end
@@ -2248,6 +2250,8 @@ mp.set_key_bindings({
function(e) process_event("shift+mouse_btn0", "down") end},
{"mouse_btn2", function(e) process_event("mouse_btn2", "up") end,
function(e) process_event("mouse_btn2", "down") end},
+ {"mouse_btn3", function(e) process_event("mouse_btn3", "press") end},
+ {"mouse_btn4", function(e) process_event("mouse_btn4", "press") end},
{"mouse_btn0_dbl", "ignore"},
{"shift+mouse_btn0_dbl", "ignore"},
{"mouse_btn2_dbl", "ignore"},