add multimedia keys
This commit is contained in:
parent
b3b068fe59
commit
34f4dbf77a
21 changed files with 1457 additions and 76 deletions
9
main.go
9
main.go
|
|
@ -66,13 +66,20 @@ func processCommand(plugin Plugin, command string) error {
|
|||
return plugin.KeyboardText(text)
|
||||
}
|
||||
arguments := strings.Split(command[1:], ";")
|
||||
if len(arguments) != 2 {
|
||||
if command[0] == 'k' && len(arguments) != 1 ||
|
||||
command[0] != 'k' && len(arguments) != 2 {
|
||||
return errors.New("wrong number of arguments")
|
||||
}
|
||||
x, err := strconv.ParseInt(arguments[0], 10, 32)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if command[0] == 'k' {
|
||||
if x < 0 || x >= int64(KeyLimit) {
|
||||
return errors.New("unsupported key")
|
||||
}
|
||||
return plugin.KeyboardKey(Key(x))
|
||||
}
|
||||
y, err := strconv.ParseInt(arguments[1], 10, 32)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue