set-grab-key-function in keymap%
Installs a callback procedure that is invoked after the keymap matches input to a function name or fails to match an input. Only one keyboard grab function can be installed at a time. When keymaps are chained to a keymap with a grab callback, the callback is invoked for matches in the chained keymap (when the chained keymap does not have its own grab callback).
If a grab callback returns a true value for a matching or non-matching callback, the event is considered handled. If the callback returns a true value for a matching callback, then the matching keymap function is not called by the keymap.
(-> voidsenda-keymapset-grab-key-functionf)
f: procedure of four arguments --- a string or#f, akeymap%object, an arbitrary value, and akey-event%object --- that returns a booleanThe callback procedure
fwill be invoked as:(fstrkmeditorevent)
The
strargument is the name of a function for a matching callback, or#ffor a non-matching callback. Thekmargument is the keymap that matched (possibly a keymap chained to the one in which the callback was installed) or the keymap in which the callback was installed. Theeditorandeventarguments are the same as passed on to the matching keymap function.Key grab callback functions are de-installed with
remove-grab-key-function.