From 7522ed82b814f0f70b814332ad54cf5cba8910a5 Mon Sep 17 00:00:00 2001 From: Rob Gill Date: Wed, 17 Jun 2020 13:01:47 +1000 Subject: [PATCH] preferences/input Add default mappings to mouse buttons 4/5 * Adds default mappings to newly added buttons 4 and 5 * Include mappings of buttons 4 and 5 in settings dump * Fixes Bug #16268 Signed-off-by: Rob Gill Change-Id: If466088e622a9e818f9eb7bd67c3a65154b9ad37 Reviewed-on: https://review.haiku-os.org/c/haiku/+/2924 Reviewed-by: waddlesplash --- src/preferences/input/MouseSettings.cpp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/preferences/input/MouseSettings.cpp b/src/preferences/input/MouseSettings.cpp index 042203bc3d..b9b2f8072d 100644 --- a/src/preferences/input/MouseSettings.cpp +++ b/src/preferences/input/MouseSettings.cpp @@ -147,7 +147,8 @@ MouseSettings::Dump() printf("type:\t\t%" B_PRId32 " button mouse\n", fSettings.type); printf("map:\t\tleft = %" B_PRIu32 " : middle = %" B_PRIu32 " : right = %" B_PRIu32 "\n", fSettings.map.button[0], fSettings.map.button[2], - fSettings.map.button[1]); + fSettings.map.button[1], fSettings.map.button[3], + fSettings.map.button[4]); printf("click speed:\t%" B_PRId64 "\n", fSettings.click_speed); printf("accel:\t\t%s\n", fSettings.accel.enabled ? "enabled" : "disabled"); printf("accel factor:\t%" B_PRId32 "\n", fSettings.accel.accel_factor); @@ -203,6 +204,8 @@ MouseSettings::Defaults() map.button[0] = B_PRIMARY_MOUSE_BUTTON; map.button[1] = B_SECONDARY_MOUSE_BUTTON; map.button[2] = B_TERTIARY_MOUSE_BUTTON; + map.button[3] = B_MOUSE_BUTTON(4); + map.button[4] = B_MOUSE_BUTTON(5); SetMapping(map); } } @@ -221,7 +224,9 @@ MouseSettings::IsDefaultable() || fAcceptFirstClick != kDefaultAcceptFirstClick || fSettings.map.button[0] != B_PRIMARY_MOUSE_BUTTON || fSettings.map.button[1] != B_SECONDARY_MOUSE_BUTTON - || fSettings.map.button[2] != B_TERTIARY_MOUSE_BUTTON; + || fSettings.map.button[2] != B_TERTIARY_MOUSE_BUTTON + || fSettings.map.button[3] != B_MOUSE_BUTTON(4) + || fSettings.map.button[4] != B_MOUSE_BUTTON(5); } @@ -254,7 +259,9 @@ MouseSettings::IsRevertable() || fAcceptFirstClick != fOriginalAcceptFirstClick || fSettings.map.button[0] != fOriginalSettings.map.button[0] || fSettings.map.button[1] != fOriginalSettings.map.button[1] - || fSettings.map.button[2] != fOriginalSettings.map.button[2]; + || fSettings.map.button[2] != fOriginalSettings.map.button[2] + || fSettings.map.button[3] != fOriginalSettings.map.button[3] + || fSettings.map.button[4] != fOriginalSettings.map.button[4]; }