| | 17 | Peppy maintains a configuration directory on a per-user basis. Where |
| | 18 | it is located depends on which platform you are using: (if you're |
| | 19 | familiar with wxWindows, it's the directory that's returned from the |
| | 20 | ``wx.StandardPaths.GetUserDataDir()`` method) |
| | 21 | |
| | 22 | * unix/linux: ``$HOME/.peppy`` |
| | 23 | * windows: ``C:/Documents and Settings/username/Application Data/Peppy`` |
| | 24 | * mac: ``~/Library/Application Support/Peppy`` |
| | 25 | |
| | 26 | There are a variety of files in that directory, used to store various bits of |
| | 27 | data for persistence between runs of peppy. The user configuration file is |
| | 28 | peppy.cfg, and the settings saved by the application go in preferences.cfg. |
| | 29 | Don't use preferences.cfg for your user settings, as they are overwritten |
| | 30 | when settings are saved after exiting the main application. Put all your |
| | 31 | hand-edited changes in peppy.cfg instead. |
| | 32 | |
| | 33 | The preferences are stored in `Windows INI`__ format. |
| | 34 | |
| | 35 | __ http://en.wikipedia.org/wiki/INI_file |
| | 60 | |
| | 61 | Key Bindings |
| | 62 | ============ |
| | 63 | |
| | 64 | There are three styles of key binding supported by peppy: windows style, Mac |
| | 65 | style, and emacs style. These are controlled by preference settings in the |
| | 66 | Preferences menu, in the General tab under the Keyboard item. This setting |
| | 67 | controls the default key bindings for all actions; actions may still be |
| | 68 | overridden manually. |
| | 69 | |
| | 70 | |
| | 71 | |
| | 72 | |
| | 73 | Configuring Key Bindings |
| | 74 | ------------------------ |
| | 75 | |
| | 76 | User specified key bindings should be stored in the peppy.cfg file in the |
| | 77 | user's preferences directory. |
| | 78 | |
| | 79 | In the ``peppy.cfg`` file, the section ``KeyboardConf`` controls user overrides |
| | 80 | to the default keybindings. |
| | 81 | |
| | 82 | An example of the section might be:: |
| | 83 | |
| | 84 | [KeyboardConf] |
| | 85 | key_bindings = "emacs" |
| | 86 | NextWord = C-N |
| | 87 | PreviousWord = C-P |
| | 88 | Paste = C-V |
| | 89 | |
| | 90 | Breaking it down by parts: |
| | 91 | |
| | 92 | [KeyboardConf] |
| | 93 | This is the section header that denotes a keyboard configuration block |
| | 94 | |
| | 95 | key_bindings = "emacs" |
| | 96 | The ``key_bindings`` variable controls the default keyboard configuration. |
| | 97 | If this variable is not present, the default configuration is automatically |
| | 98 | determined based on the platform. To set this variable, it should use one |
| | 99 | of the following values: "emacs", "win", or "mac". |
| | 100 | |
| | 101 | NextWord = C-n |
| | 102 | The remaining entries in the section are keybindings. The format of each |
| | 103 | line is ``ActionName = keybinding``, where ``ActionName`` is the |
| | 104 | class name of the action you wish to rebind. Currently, the easiest way |
| | 105 | to discover these name is to run peppy with the ``--show-key-bindings`` |
| | 106 | argument, which will display all of the current keybindings to the console |
| | 107 | in a format usable for the ``KeyboardConf`` section of the preferences. |
| | 108 | You can also use the menu item ``Help -> Show Key Bindings``, or when all |
| | 109 | else fails you can look at the source code. (A GUI to change the keybindings |
| | 110 | is ticket #53 on the roadmap. Feel free to add suggestions there.) |
| | 111 | |
| | 112 | To specify keystrokes, consult the section below. |
| | 113 | |
| | 114 | |
| | 115 | |
| | 116 | Describing Keystrokes |
| | 117 | --------------------- |
| | 118 | |
| | 119 | To modify the key bindings, Key bindings are specified using a special |
| | 120 | shorthand showing the modifiers of the key and the key itself. Modifiers are: |
| | 121 | |
| | 122 | * **S** - Shift |
| | 123 | * **C** - Control on win/unix, Command on mac |
| | 124 | * **M** - Meta or Alt on win/unix, Option on mac |
| | 125 | |
| | 126 | Keys are then specified using a string listing the modifier characters |
| | 127 | separated by the - character, and then the unshifted character itself. |
| | 128 | Unmodified keys are also possible -- if the keystroke doesn't contain a - |
| | 129 | character it is used as a literal character. For example: |
| | 130 | |
| | 131 | * **x** - the letter X |
| | 132 | * **s** - the letter S |
| | 133 | * **S-s** - shift S |
| | 134 | * **C-a** - control A |
| | 135 | * **S-/** - shift slash (note that you can't specify a ? directly -- keys are recognized by their unshifted state in wx) |
| | 136 | * **M-C-q** - alt control Q |
| | 137 | |
| | 138 | Multiple keystrokes are separated by spaces: |
| | 139 | |
| | 140 | * **C-x C-s** - control X followed by control S |
| | 141 | * **C-x 5 2** - control X followed by the number 5 followed by the number 2 |
| | 142 | |
| | 143 | Special characters are given by their text equivalent: |
| | 144 | |
| | 145 | * **TAB** - the tab key |
| | 146 | * **S-UP** - shift up arrow |
| | 147 | |
| | 148 | Here's a list of special characters (note that if you're familiar with |
| | 149 | wxPython, this is really just the `WXK_` name with the `WXK_` prefix removed): |
| | 150 | |
| | 151 | BACK TAB RETURN ESCAPE SPACE DELETE START LBUTTON RBUTTON CANCEL MBUTTON |
| | 152 | CLEAR PAUSE CAPITAL PRIOR NEXT END HOME LEFT UP RIGHT DOWN SELECT PRINT |
| | 153 | EXECUTE SNAPSHOT INSERT HELP NUMPAD0 NUMPAD1 NUMPAD2 NUMPAD3 NUMPAD4 NUMPAD5 |
| | 154 | NUMPAD6 NUMPAD7 NUMPAD8 NUMPAD9 MULTIPLY ADD SEPARATOR SUBTRACT DECIMAL |
| | 155 | DIVIDE F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12 F13 F14 F15 F16 F17 F18 F19 |
| | 156 | F20 F21 F22 F23 F24 NUMLOCK SCROLL PAGEUP PAGEDOWN NUMPAD_SPACE NUMPAD_TAB |
| | 157 | NUMPAD_ENTER NUMPAD_F1 NUMPAD_F2 NUMPAD_F3 NUMPAD_F4 NUMPAD_HOME NUMPAD_LEFT |
| | 158 | NUMPAD_UP NUMPAD_RIGHT NUMPAD_DOWN NUMPAD_PRIOR NUMPAD_PAGEUP NUMPAD_NEXT |
| | 159 | NUMPAD_PAGEDOWN NUMPAD_END NUMPAD_BEGIN NUMPAD_INSERT NUMPAD_DELETE |
| | 160 | NUMPAD_EQUAL NUMPAD_MULTIPLY NUMPAD_ADD NUMPAD_SEPARATOR NUMPAD_SUBTRACT |
| | 161 | NUMPAD_DECIMAL NUMPAD_DIVIDE |
| | 162 | |
| | 163 | |
| | 164 | |
| | 165 | |
| | 166 | |