From 7897f79217af1e04e6e65bd72e938058e84c451a Mon Sep 17 00:00:00 2001 From: James Ross-Gowan Date: Sun, 3 Sep 2017 00:00:52 +1000 Subject: input: merge mouse wheel and axis keycodes Mouse wheel bindings have always been a cause of user confusion. Previously, on Wayland and macOS, precise touchpads would generate AXIS keycodes and notched mouse wheels would generate mouse button keycodes. On Windows, both types of device would generate AXIS keycodes and on X11, both types of device would generate mouse button keycodes. This made it pretty difficult for users to modify their mouse-wheel bindings, since it differed between platforms and in some cases, between devices. To make it more confusing, the keycodes used on Windows were changed in 18a45a42d524 without a deprecation period or adequate communication to users. This change aims to make mouse wheel binds less confusing. Both the mouse button and AXIS keycodes are now deprecated aliases of the new WHEEL keycodes. This will technically break input configs on Wayland and macOS that assign different commands to precise and non-precise scroll events, but this is probably uncommon (if anyone does it at all) and I think it's a fair tradeoff for finally fixing mouse wheel-related confusion on other platforms. --- video/out/x11_common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'video/out/x11_common.c') diff --git a/video/out/x11_common.c b/video/out/x11_common.c index 6fb4e94995..5f2c658a9c 100644 --- a/video/out/x11_common.c +++ b/video/out/x11_common.c @@ -1136,7 +1136,7 @@ void vo_x11_check_events(struct vo *vo) if (Event.xbutton.button == 1) x11->win_drag_button1_down = true; mp_input_put_key(x11->input_ctx, - (MP_MOUSE_BASE + Event.xbutton.button - 1) | + (MP_MBTN_BASE + Event.xbutton.button - 1) | get_mods(Event.xbutton.state) | MP_KEY_STATE_DOWN); long msg[4] = {XEMBED_REQUEST_FOCUS}; vo_x11_xembed_send_message(x11, msg); @@ -1145,7 +1145,7 @@ void vo_x11_check_events(struct vo *vo) if (Event.xbutton.button == 1) x11->win_drag_button1_down = false; mp_input_put_key(x11->input_ctx, - (MP_MOUSE_BASE + Event.xbutton.button - 1) | + (MP_MBTN_BASE + Event.xbutton.button - 1) | get_mods(Event.xbutton.state) | MP_KEY_STATE_UP); break; case MapNotify: -- cgit v1.2.3