Skip to content

Commit

Permalink
feat: add GrabCheckedV2
Browse files Browse the repository at this point in the history
  • Loading branch information
zsien committed Apr 11, 2024
1 parent 230ea41 commit 0853ce5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion util/keybind/keybind.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,13 @@ func Ungrab(conn *x.Conn, win x.Window, mods uint16, key x.Keycode) {
}

func GrabChecked(conn *x.Conn, win x.Window, mods uint16, key x.Keycode) error {
return GrabCheckedV2(conn, win, mods, key, x.GrabModeAsync, x.GrabModeAsync)
}

func GrabCheckedV2(conn *x.Conn, win x.Window, mods uint16, key x.Keycode, pointerMode uint8, keyboardMode uint8) error {
for _, m := range grabMods {
err := x.GrabKeyChecked(conn, true, win, mods|m,
key, x.GrabModeAsync, x.GrabModeAsync).Check(conn)
key, pointerMode, keyboardMode).Check(conn)
if err != nil {
return err
}
Expand Down

0 comments on commit 0853ce5

Please sign in to comment.