KeyEvent
Source code in pzp/keys.py
69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
__init__(ch, action)
Key Event represents a key action on the keyboard.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
ch |
str
|
Pressed key |
required |
action |
Optional[str]
|
Action |
required |
Attributes:
Name | Type | Description |
---|---|---|
ch |
Pressed key |
|
action |
Action |
Source code in pzp/keys.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
KeysHandler
Source code in pzp/keys.py
89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 |
|
__init__(keys_binding=None)
Keys handler is a collection of bindings of keys to actions.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
keys_binding |
Optional[KeysBinding]
|
Custom key binding |
None
|
Attributes:
Name | Type | Description |
---|---|---|
keycodes_actions |
key => action mapping |
Source code in pzp/keys.py
90 91 92 93 94 95 96 97 98 99 100 101 102 |
|
set_key_binding(key, action)
Add a binding for one key to an action
Source code in pzp/keys.py
113 114 115 |
|
set_keys_binding(keys, action)
Add a binding for one or more keys to an action
Source code in pzp/keys.py
108 109 110 111 |
|
key_to_str(ch)
Return the textual representation of a char
Source code in pzp/keys.py
64 65 66 |
|