improved the docs a little bit for writing your own keybindings
svn: r12232
This commit is contained in:
parent
95bedb17fb
commit
90c0d48642
|
@ -171,19 +171,18 @@ as the @tech{definitions window} plus a few more:
|
||||||
The @onscreen{Add User-defined Keybindings...} menu item in the
|
The @onscreen{Add User-defined Keybindings...} menu item in the
|
||||||
@onscreen{Keybindings} sub-menu of @onscreen{Edit} selects a file
|
@onscreen{Keybindings} sub-menu of @onscreen{Edit} selects a file
|
||||||
containing Scheme definitions of keybindings. The file must contain a
|
containing Scheme definitions of keybindings. The file must contain a
|
||||||
single module that uses a special keybindings language,
|
module that uses a special keybindings language,
|
||||||
@scheme[framework/keybinding-lang]. For example, a file named
|
@scheme[framework/keybinding-lang]. To do so, begin your file with
|
||||||
@filepath{mykeys.ss} for keybindings might contain the following
|
this line:
|
||||||
code:
|
|
||||||
|
|
||||||
@schemeblock[
|
@schememod[
|
||||||
(module mykeys framework/keybinding-lang
|
s-exp framework/keybinding-lang
|
||||||
...)
|
|
||||||
]
|
]
|
||||||
|
|
||||||
The @scheme[framework/keybinding-lang] languages provides all bindings
|
The @scheme[framework/keybinding-lang] languages provides all of the bindings
|
||||||
@schememodname[mzscheme], @schememodname[scheme/gui/base], and
|
from @schememodname[scheme], @schememodname[scheme/class], and
|
||||||
@scheme[scheme/classs], except that it adjusts @|mz-mod-begin| to
|
@schememodname[drscheme/tool-lib],
|
||||||
|
except that it adjusts @|mz-mod-begin| to
|
||||||
introduce a @schemeidfont{keybinding} form:
|
introduce a @schemeidfont{keybinding} form:
|
||||||
|
|
||||||
@specform[#:literals (keybindings)
|
@specform[#:literals (keybindings)
|
||||||
|
@ -194,9 +193,9 @@ suitable first argument for @xmethod[keymap% map-function], and the
|
||||||
@scheme[proc-expr] must produce a suitable second argument for
|
@scheme[proc-expr] must produce a suitable second argument for
|
||||||
@xmethod[keymap% add-function].}
|
@xmethod[keymap% add-function].}
|
||||||
|
|
||||||
Note that @schememodname[drscheme/tool-lib] adds all of the names
|
For example, this remaps the key combination ``control-a'' key to ``!''.
|
||||||
defined in @other-manual['(lib "scribblings/tools/tools.scrbl")] to
|
|
||||||
your keybindings module, which helps in defining DrScheme-specific
|
|
||||||
keybindings.
|
|
||||||
|
|
||||||
|
|
||||||
|
@schememod[
|
||||||
|
s-exp framework/keybinding-lang
|
||||||
|
(keybinding "c:a" (λ (editor evt) (send editor insert "!")))
|
||||||
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user