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.
( -> void
send a-keymap set-grab-key-function f)
f : procedure of four arguments --- a string or #f, a keymap% object, an arbitrary value, and a key-event% object --- that returns a boolean
The callback procedure f will be invoked as:
(
f str km editor event)
The str argument is the name of a function for a matching
callback, or #f for a non-matching callback. The km
argument 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. The editor and event arguments are
the same as passed on to the matching keymap function.
Key grab callback functions are de-installed with
remove-grab-key-function.