diff --git a/src/backends/native/meta-input-settings-native.c b/src/backends/native/meta-input-settings-native.c index abf07510a..82719e7d8 100644 --- a/src/backends/native/meta-input-settings-native.c +++ b/src/backends/native/meta-input-settings-native.c @@ -287,12 +287,26 @@ meta_input_settings_native_set_scroll_button (MetaInputSettings *settings, } else { - /* Compensate for X11 scroll buttons */ - if (button > 7) - button -= 4; + switch (button) + { + case 1: + evcode = BTN_LEFT; + break; + case 2: + evcode = BTN_MIDDLE; + break; + case 3: + evcode = BTN_RIGHT; + break; + default: + /* Compensate for X11 scroll buttons */ + if (button > 7) + button -= 4; + + /* Button is 1-indexed */ + evcode = (BTN_LEFT - 1) + button; + } - /* Button is 1-indexed */ - evcode = (BTN_LEFT - 1) + button; method = LIBINPUT_CONFIG_SCROLL_ON_BUTTON_DOWN; }