Added info about unicode escape support for keybindings with `chars`

Florian Beeres 2020-04-26 11:40:46 +02:00
parent 2b80bf8bab
commit eb00736ad1
1 changed files with 4 additions and 2 deletions

@ -19,13 +19,15 @@ We're interested in:
- The value between the brackets of `Some`, which is the one to use in the key property of the mapping - The value between the brackets of `Some`, which is the one to use in the key property of the mapping
- The boolean properties in `ModifiersState`, which indicate which modifiers to add in the mods property of the mapping (these can be concatenated using the `|` character) - The boolean properties in `ModifiersState`, which indicate which modifiers to add in the mods property of the mapping (these can be concatenated using the `|` character)
The value for the `chars` property of each entry in `key_bindings:` can be any text string and supports hexadecimal escapes: The value for the `chars` property of each entry in `key_bindings:` can be any text string and supports both hexadecimal (`\xNN`) and unicode (`\uNNNN`) escapes:
```yml ```yml
# Insert the `[` character # Insert the `[` character
- { key: LBracket, mods: Alt, chars: "[" } - { key: LBracket, mods: Alt, chars: "[" }
# Send the Ctrl+C control using its hex value # Send the Ctrl+C control using its hex value...
- { key: T, mods: Control|Shift, chars: "\x03" } - { key: T, mods: Control|Shift, chars: "\x03" }
# ... or using its unicode value
- { key: T, mods: Control|Shift, chars: "\u0003" }
``` ```
### The `virtual_keycode` is `None` ### The `virtual_keycode` is `None`