The gadget with keyboard focus is the current receiver of keyboard gestures and user input. Gadgets that wish to receive keyboard input should request focus when clicked:
request-focus ( gadget -- )
The following example demonstrates defining a handler for a mouse click gesture which requests focus:
my-gadget H{
{ T{ button-down } [ request-focus ] }
} set-gestures
To nominate a single child as the default focusable child, implement a method on a generic word:
focusable-child* ( gadget -- child/f )
Gestures are sent to a gadget when it gains or loses focus; this can be used to change the gadget's appearance, for example by displaying a border:
gain-focus
lose-focus
This documentation was generated offline from a
load-all
image. If you want, you can also
browse the documentation from within the UI developer tools . See
the Factor website
for more information.
Factor 0.101 x86.64 (2282, heads/master-877e79c8e5, Oct 29 2024 15:58:10)