mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
app: [linux,windows,wasm] scroll horizontally when shift key is pressed
Adds support for horizontal scroll using mousewheel with a shift key. Support is added for windows, linux (wayland and x11), js (wasm). Fixes: https://todo.sr.ht/~eliasnaur/gio/398 Signed-off-by: Mearaj <mearajbhagad@gmail.com>
This commit is contained in:
+6
-1
@@ -531,7 +531,12 @@ func (w *window) scrollEvent(wParam, lParam uintptr, horizontal bool, kmods key.
|
||||
if horizontal {
|
||||
sp.X = dist
|
||||
} else {
|
||||
sp.Y = -dist
|
||||
// support horizontal scroll (shift + mousewheel)
|
||||
if kmods == key.ModShift {
|
||||
sp.X = -dist
|
||||
} else {
|
||||
sp.Y = -dist
|
||||
}
|
||||
}
|
||||
w.w.Event(pointer.Event{
|
||||
Type: pointer.Scroll,
|
||||
|
||||
Reference in New Issue
Block a user