replace --keyboard-name with $DOTOOL_KEYBOARD_NAME
This commit is contained in:
parent
ba251d1afd
commit
5404859248
2 changed files with 11 additions and 13 deletions
|
@ -39,6 +39,10 @@ and *DOTOOL_XKB_VARIANT*. For example:
|
|||
|
||||
*echo type azerty | DOTOOL_XKB_LAYOUT=fr dotool*
|
||||
|
||||
You can also specify the name to give the virtual keyboard with the environment
|
||||
variable *DOTOOL_KEYBOARD_NAME*, which can be useful making rules for your
|
||||
environment.
|
||||
|
||||
Currently the *type* action has only heuristic support for dead keys.
|
||||
|
||||
# OPTIONS
|
||||
|
@ -46,9 +50,6 @@ Currently the *type* action has only heuristic support for dead keys.
|
|||
*-h*, *--help*
|
||||
Print help and exit.
|
||||
|
||||
*--keyboard-name=*_NAME_
|
||||
Specify the name to give the virtual keyboard device.
|
||||
|
||||
*--list-keys*
|
||||
Print the possible Linux keys and exit.
|
||||
|
||||
|
|
17
dotool.go
17
dotool.go
|
@ -37,10 +37,9 @@ The supported actions are:
|
|||
typedelay MILLISECONDS
|
||||
typehold MILLISECONDS
|
||||
|
||||
--keyboard-name=NAME Specify the name to give the keyboard device.
|
||||
--list-keys Print the possible Linux keys and exit.
|
||||
--list-x-keys Print the possible XKB keys and exit.
|
||||
--version Print the version and exit.
|
||||
--list-keys Print the possible Linux keys and exit.
|
||||
--list-x-keys Print the possible XKB keys and exit.
|
||||
--version Print the version and exit.
|
||||
|
||||
See 'man dotool' for the documentation.`)
|
||||
}
|
||||
|
@ -230,7 +229,6 @@ func main() {
|
|||
initKeys(keymap)
|
||||
}
|
||||
|
||||
keyboardName := []byte("dotool keyboard")
|
||||
{
|
||||
o := opt.NewOptSet()
|
||||
|
||||
|
@ -241,11 +239,6 @@ func main() {
|
|||
})
|
||||
o.Alias("h", "help")
|
||||
|
||||
o.Func("keyboard-name", func(s string) error {
|
||||
keyboardName = []byte(s)
|
||||
return nil
|
||||
})
|
||||
|
||||
o.FlagFunc("list-keys", func() error {
|
||||
listKeys(keymap, LinuxKeys)
|
||||
os.Exit(0)
|
||||
|
@ -273,6 +266,10 @@ func main() {
|
|||
}
|
||||
}
|
||||
|
||||
keyboardName := []byte(os.Getenv("DOTOOL_KEYBOARD_NAME"))
|
||||
if len(keyboardName) == 0 {
|
||||
keyboardName = []byte("dotool keyboard")
|
||||
}
|
||||
keyboard, err := uinput.CreateKeyboard("/dev/uinput", keyboardName)
|
||||
if err != nil {
|
||||
fatal(err.Error())
|
||||
|
|
Loading…
Reference in a new issue