Used to define actions on keys in anywhere you can edit text.

'prekey' : {
    'key_tab' : '@me.insertindentation()',
    'key_backtab' : '@me.removeindentation()',
'postkey' : {
    'key_enter' : '@me.autoindent()',
    'key_return' : '@me.autoindent()',

The basic structure. You can used named elements, number values and char values as keys. Each of the keys will then either have a direct element value that is the action to run or you can add a key modifier structure to filter on control key as well as just the main key.

Prekey actions

This is filters run before the default key action is run. If this method return True, it will stop the default key action. This can be used to stop keys from being pressed. Ex. enter not allowed, can be done by adding a default action on the 'key_enter' of type True.

Postkey actions

These action can not stop the default action to happen as they are done after the default key action. They can be used to do something extra after the default action has been done. Ex. add the same indent in a editor as the line you came from on key_enter.

The valid keys as text


All the keys that can be written as text string. You can also use a single character for all the normal chars like 'A', 'a' etc. or a numeric value for all not in this list. The list is just the most commonly used characters. To get the full list, look up the Qt documentation on key enums.

The valid modifiers


This are the only supported. If you want to use any, make sure that you add the normal action to handle without modifiers as a 'no' modifier.