From 78b54615cc4721acc041a2f4ea3b92ab8779fefc Mon Sep 17 00:00:00 2001 From: Walter Werner SCHNEIDER Date: Fri, 11 Jul 2025 22:25:45 +0300 Subject: [PATCH] app: [Wayland] add forth and fifth buttons Signed-off-by: Walter Werner SCHNEIDER --- app/os_wayland.go | 8 +++++++- io/pointer/pointer.go | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/os_wayland.go b/app/os_wayland.go index b2636152..b020c6d1 100644 --- a/app/os_wayland.go +++ b/app/os_wayland.go @@ -884,11 +884,13 @@ func gio_onPointerButton(data unsafe.Pointer, p *C.struct_wl_pointer, serial, t, s := callbackLoad(data).(*wlSeat) s.serial = serial w := s.pointerFocus - // From linux-event-codes.h. + // From Linux: include/uapi/linux/input-event-codes.h const ( BTN_LEFT = 0x110 BTN_RIGHT = 0x111 BTN_MIDDLE = 0x112 + BTN_SIDE = 0x113 + BTN_EXTRA = 0x114 ) var btn pointer.Buttons switch wbtn { @@ -898,6 +900,10 @@ func gio_onPointerButton(data unsafe.Pointer, p *C.struct_wl_pointer, serial, t, btn = pointer.ButtonSecondary case BTN_MIDDLE: btn = pointer.ButtonTertiary + case BTN_SIDE: + btn = pointer.ButtonQuaternary + case BTN_EXTRA: + btn = pointer.ButtonQuinary default: return } diff --git a/io/pointer/pointer.go b/io/pointer/pointer.go index 8c5825bd..a65f840c 100644 --- a/io/pointer/pointer.go +++ b/io/pointer/pointer.go @@ -220,7 +220,7 @@ const ( // ButtonTertiary is the tertiary button, usually the middle button. ButtonTertiary // ButtonQuaternary is the fourth button, usually used for browser - // navigation (back) + // navigation (backward) ButtonQuaternary // ButtonQuinary is the fifth button, usually used for browser // navigation (forward)