Use internal constants for pointer buttons, instead of x11 mapping
This commit is contained in:
parent
07678e56ab
commit
b3b068fe59
7 changed files with 54 additions and 30 deletions
4
main.go
4
main.go
|
|
@ -84,14 +84,14 @@ func processCommand(plugin Plugin, command string) error {
|
|||
return plugin.PointerScroll(int(x), int(y))
|
||||
}
|
||||
if command[0] == 'b' {
|
||||
if x <= 0 || x > 3 {
|
||||
if x < 0 || x >= int64(PointerButtonLimit) {
|
||||
return errors.New("unsupported pointer button")
|
||||
}
|
||||
b := true
|
||||
if y == 0 {
|
||||
b = false
|
||||
}
|
||||
return plugin.PointerButton(uint(x), b)
|
||||
return plugin.PointerButton(PointerButton(x), b)
|
||||
}
|
||||
return errors.New("unsupported command")
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue