Mention index, get and the fact that all but ALPHA keys are case-sensitive to docs
This commit is contained in:
parent
7d46e701aa
commit
8950e45325
15
docs/keys.md
15
docs/keys.md
@ -166,3 +166,18 @@ have my handlers attached:
|
|||||||
```python
|
```python
|
||||||
SHREKLESS_ALT = KC.LALT.clone()
|
SHREKLESS_ALT = KC.LALT.clone()
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also refer to a key by index:
|
||||||
|
* KC['A']
|
||||||
|
* KC['NO']
|
||||||
|
* KC['LALT']
|
||||||
|
|
||||||
|
or the get function which has an optional argument of `default`. `default` is
|
||||||
|
be returned if the key is not found (`None` unless otherwise specified):
|
||||||
|
* KC.get('A')
|
||||||
|
* KC.get('NO', None)
|
||||||
|
* KC.get('NOT DEFINED', KC.RALT)
|
||||||
|
|
||||||
|
Keys names are case-sensitive. KC['NO'] being different from KC['no']. It is recommended
|
||||||
|
that names are capitalised typically. The exception to this is alphabetical; KC['A'] and
|
||||||
|
KC['a'] will both return the same, unshifted, key.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user