Next: Scheme Mode Keyboard Mapping
Up: Application Toolbox
Previous: Hyper-text
Keyboard and mouse mappings are specified with instances of the
toolbox class wx:keymap%. Each instance of
mred:edit% contains a private keymap that is
intialized by the following:
-
(mred:set-keymap-implied-shifts keymap) -- This
configures the keymap with information about keys that are accessed by
using the shift key on the current keyboard. For example, ``?'' is
accessed with the shift key on most keyboards. This information is
used when keyboard mappings are specified. For example, if ``?'' is
configured as an implied-shift key and if the unshifted key for ``?''
is ``/'', then the key string ``c:?'' actually matches the keyboard
combination Control-Shift-/. The list of implied-shift keys installed by
mred:set-keymap-implied-shifts is in the global variable
mred:shifted-key-list .
-
(mred:set-keymap-error-handler keymap) -- This
installs an error handler for the keymap that calls the
Scheme error procedure.
- (send keymap chain-to-keymap mred:global-keymap #f)
-- This installs the global keymap mred:global-keymap to
handle keyboard and mouse mappings not handled by keymap. The
global keymap is created at system start-up time and initialized
by
(mred:setup-global-keymap mred:global-keymap).
For information about key combination specifications, the
implies-shift method, and the keymap error handler, see the
documentation for wx:keymap% class.
Most keyboard and mouse mappings are inserted into a keymap by calling
the keymap's map-function method. However, ``meta'' combinations
require special attention. The ``m:'' prefix recognized by
map-function applies only to the Meta key that exists on
some keyboards. By convention, however, ``meta'' combinations can also be
accessed by using ``ESC'' or ``c:['' as a prefix. Further, it may be
useful to use a different modifier key for ``meta'' on platforms
without a Meta key. Therefore, the procedure
mred:send-map-function-meta is used to generalize meta
combinations. This procedure takes a keymap, a base key specification,
and a function name; it prefixes the base key with all ``meta''
combination prefixes, and installs the new combinations into the
keymap. For example,
(mred:send-map-function-meta keymap "a" func)
might map all of ``m:a'', ``ESC;a'', and ``c:[;a'' to func.
All of the prefixes used for ``meta'' are in the global list
mred:meta-prefix-list.
The global keymap contains the following functions (in
addition to the functions built into buffers (see the
wx:keymap% class documentation.):
- ``ring-bell'' (any events) -- Rings the bell (using wx:bell) and
removes the search panel from the frame, if there.
- ``save-file'' (key events) -- Saves the buffer. If the buffer has
no name, then mred:put-file is invoked.
- ``save-file-as'' (key events) -- Calls mred:put-file to save
the buffer.
- ``load-file'' (key events) -- Invokes mred:open-file.
- ``find-string'' (key events) -- Opens the search buffer at the bottom
of the frame, unless it is already open, in which case it searches for the
text in the search buffer.
- ``find-string-reverse'' (key events) -- Same a ``find-string'', but in
the reverse direction.
- ``find-string-replace'' (key events) -- Opens a replace string dialog
box.
- ``toggle-anchor'' (key events) -- Turns selection-anchoring on or off.
- ``center-view-on-line'' (key events) -- Centers the buffer in its
display using the currently selected line.
- ``collapse-space'' (key events) -- Collapses all non-return whitespace
around the caret into a single space.
- ``remove-space'' (key events) -- Removes all non-return whitespace
around the caret.
- ``collapse-newline'' (key events) -- Collapses all empty lines
around the caret into a single empty line. If there is only
one empty line, it is removed.
- ``open-line'' (key events) -- Inserts a new line.
- ``transpose-chars'' (key events) -- Transposes the characters before
and after the caret and moves forward one position.
- ``transpose-words'' (key events) -- Transposes words before
and after the caret and moves forward one word.
- ``capitalize-word'' (key events) -- Changes the first character
of the next word to a capital letter and moves to the end of the
word.
- ``upcase-word'' (key events) -- Changes all characters
of the next word to capital letters and moves to the end of the
word.
- ``downcase-word'' (key events) -- Changes all characters
of the next word to lowercase letters and moves to the end of the
word.
- ``kill-word'' (key events) -- Kills the next word.
- ``backward-kill-word'' (key events) -- Kills the previous word.
- ``goto-line'' (any events) -- Queries the user for a line number and moves
the caret there.
- ``goto-position'' (any events) -- Queries the user for a position number
and moves the caret there.
- ``copy-clipboard'' (mouse events) -- Copies the current selection to the
clipboard.
- ``cut-clipboard'' (mouse events) -- Cuts the current selection to the
clipboard.
- ``paste-clipboard'' (mouse events) -- Patses the clipboard to the current
selection.
- ``copy-click-region'' (mouse events) -- Copies the region between the
caret and the input mouse event.
- ``cut-click-region'' (mouse events) -- Cuts the region between the
caret and the input mouse event.
- ``paste-click-region'' (mouse events) -- Pastes the clipboard into the
position of the input mouse event.
- ``select-click-word'' (mouse events) -- Selects the word under the
input mouse event.
- ``select-click-line'' (mouse events) -- Selects the line under the
input mouse event.
- ``start-macro'' (key events) - Starts building a keyboard macro
- ``end-macro'' (key events) -- Stops building a keyboard macro
- ``do-macro'' (key events) -- Executes the last keyboard macro
- ``toggle-overwrite'' (key events) -- Toggles overwriting mode
These functions are bound to the following keys (C = control, S =
shift, A = alt, M = ``meta'', D = command):
- C-g : ``ring-bell''
- M-C-g : ``ring-bell''
- C-c C-g : ``ring-bell''
- C-x C-g : ``ring-bell''
- C-p : ``previous-line''
- S-C-p : ``select-previous-line''
- C-n : ``next-line''
- S-C-n : ``select-next-line''
- C-e : ``end-of-line''
- S-C-e : ``select-to-end-of-line''
- D-RIGHT : ``end-of-line''
- S-D-RIGHT : ``select-to-end-of-line''
- M-RIGHT : ``end-of-line''
- S-M-RIGHT : ``select-to-end-of-line''
- C-a : ``beginning-of-line''
- S-C-a : ``select-to-beginning-of-line''
- D-LEFT : ``beginning-of-line''
- D-S-LEFT : ``select-to-beginning-of-line''
- M-LEFT : ``beginning-of-line''
- M-S-LEFT : ``select-to-beginning-of-line''
- C-h : ``delete-previous-character''
- C-d : ``delete-next-character''
- C-f : ``forward-character''
- S-C-f : ``select-forward-character''
- C-b : ``backward-character''
- S-C-b : ``select-backward-character''
- M-f : ``forward-word''
- S-M-f : ``select-forward-word''
- A-RIGHT : ``forward-word''
- A-S-RIGHT : ``forward-select-word''
- M-b : ``backward-word''
- S-M-b : ``select-backward-word''
- A-LEFT : ``backward-word''
- A-S-LEFT : ``backward-select-word''
- M-d : ``kill-word''
- M-DELETE : ``backward-kill-word''
- M-c : ``capitalize-word''
- M-u : ``upcase-word''
- M-l : ``downcase-word''
- M-< : ``beginning-of-file''
- S-M-< : ``select-to-beginning-of-file''
- M-> : ``end-of-file''
- S-M-> : ``select-to-end-of-file''
- C-v : ``next-page''
- S-C-v : ``select-next-page''
- M-v : ``previous-page''
- S-M-v : ``select-previous-page''
- C-l : ``center-view-on-line''
- C-k : ``delete-to-end-of-line''
- C-y : ``paste-clipboard'' (Except Windows)
- A-v : ``paste-clipboard''
- D-v : ``paste-clipboard''
- C-_ : ``undo''
- C-x u : ``undo''
- C-+ : ``redo''
- C-w : ``cut-clipboard''
- M-w : ``copy-clipboard''
- C-x C-s : ``save-file''
- C-x C-w : ``save-file-as''
- C-x C-f : ``load-file''
- C-s : ``find-string''
- C-r : ``find-string-reverse''
- M-% : ``find-string-replace''
- SPACE : ``collapse-space''
- M- : ``remove-space''
- C-x C-o : ``collapse-newline''
- C-o : ``open-line''
- C-t : ``transpose-chars''
- M-t : ``transpose-words''
- C-SPACE : ``toggle-anchor''
- M-g : ``goto-line''
- M-p : ``goto-position''
- LEFTBUTTONTRIPLE : ``select-click-line''
- LEFTBUTTONDOUBLE : ``select-click-word''
- RIGHTBUTTON : ``copy-click-region''
- RIGHTBUTTONDOUBLE : ``cut-click-region''
- MIDDLEBUTTON : ``paste-click-region''
- C-RIGHTBUTTON : ``copy-clipboard''
- INSERT : ``toggle-overwrite''
- M-o : ``toggle-overwrite''
Next: Scheme Mode Keyboard Mapping
Up: Application Toolbox
Previous: Hyper-text
PLT