KeyDownActions supplies key-mappings for different platforms as classvars. Furthermore it's responsible for handling global shortcuts. Global shortcuts that work independently from SClang or any GUI. The actions connected to the shortcuts can be invoked independently from which application is currently the frontmost.
An IdentityDictionary, containing key-mappings in key-value pairs: e.g.
or
A key can be a single Char or a Symbol, the number is the keycode returned for the key. The snippet creates a window that has a keyDownAction associated which posts key-value pairs for arbitrary keystrokes. You may use this code if the default keyCodes doesn't match the ones on your platform. Edit keyCodes by using the KeyCodesEditor.
This special classvar turned out to be necessary as the modifiers when using the arrow-keys are different to the ones using other keys. Use the following snippet to determine (arrow) modifiers on your platform (you may use the same code to test the result of the other modifier related classvars as well).
Same as arrowsModifiersQt. Even though this variable exists using Linux too it has no relevance there.
Set the key-down actions of the given View according to the shortcuts given in shortcutsDict.
keyDownAction
. Note also the corresponding instance method KeyDownActionsEditor: -setShortcutsview |
a View or any object that responds to |
shortcutsDict |
a Dictionary or (better) an IdentityDictionary defining the key-down actions that shall be added to the given view. The dictionary must be formatted as follows: |
this (KeyDownActions
)
Set or get global shortcuts. Global shortcuts will independently from the program that is currently the frontmost one. However, they depend on a Synth that listen's to the user's keystrokes. The listening Synth will use one UGen per key. Also note that global shortcuts can only use a single keystroke (no combination of modifier and key).