KeyboardProcessing - robmcmullen/peppy GitHub Wiki
Keyboard processing in peppy is a bit complicated because it can handle multi-stroke commands as in Emacs.
Background info on Emacs-style keybindigs:
- http://www.emacswiki.org/cgi-bin/wiki/EmacsNewbieKeyReference
- http://www.nongnu.org/emacs-tiny-tools/keybindings/
- List of EmacsKeyBindings
Key bindings are specified using a special shorthand showing the modifiers of the key and the key itself. Modifiers are:
- S- Shift
- C- Control on win/unix, Command on mac
- !^ Control on all platforms
- M- Meta or Alt on win/unix, Option on mac
- x the letter X
- s the letter S
- S-s shift S
- C-a control A on win/unix, Command A on mac
- !^Q control Q on all platforms
- S-/ shift slash (note that you can't specify a ? directly -- keys are recognized by their unshifted state in wx)
- M-C-q alt control Q
- C-x C-s control X followed by control S
- C-x 5 2 control X followed by the number 5 followed by the number 2
- TAB the tab key
- S-UP shift up arrow
BACK TAB RETURN ESCAPE SPACE DELETE START LBUTTON RBUTTON CANCEL MBUTTON CLEAR PAUSE CAPITAL PRIOR NEXT END HOME LEFT UP RIGHT DOWN SELECT PRINT EXECUTE SNAPSHOT INSERT HELP NUMPAD0 NUMPAD1 NUMPAD2 NUMPAD3 NUMPAD4 NUMPAD5 NUMPAD6 NUMPAD7 NUMPAD8 NUMPAD9 MULTIPLY ADD SEPARATOR SUBTRACT DECIMAL DIVIDE F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 F20 F21 F22 F23 F24 NUMLOCK SCROLL PAGEUP PAGEDOWN NUMPAD_SPACE NUMPAD_TAB NUMPAD_ENTER NUMPAD_F1 NUMPAD_F2 NUMPAD_F3 NUMPAD_F4 NUMPAD_HOME NUMPAD_LEFT NUMPAD_UP NUMPAD_RIGHT NUMPAD_DOWN NUMPAD_PRIOR NUMPAD_PAGEUP NUMPAD_NEXT NUMPAD_PAGEDOWN NUMPAD_END NUMPAD_BEGIN NUMPAD_INSERT NUMPAD_DELETE NUMPAD_EQUAL NUMPAD_MULTIPLY NUMPAD_ADD NUMPAD_SEPARATOR NUMPAD_SUBTRACT NUMPAD_DECIMAL NUMPAD_DIVIDE
Default key bindings are specified in each action. Each action includes (or can include) a class attribute called key_bindings that, when not None, is a dict that maps the key set name (i.e. "win", "mac", "emacs") to the keystroke. There is also a key set named "default" that will be applied to all platforms unless overridden by a specific platform. For example:
key_bindings = {'default': "C-e", 'mac': "C-a", 'emacs': "C-x C-n"}
will set the mac keybinding to Command A, the emacs keybinding to the keystroke sequence Control X followed by Control N, and because windows is not specified explicitly, the default keybinding will be Control E on windows.
See ConfigurationFiles for information on how to customize keybindings.