button-down
Factor documentation > Factor handbook > UI framework > Implementing new gadgets > UI gestures > Mouse gestures
Next:button-up


Vocabulary
ui.gestures

Class description
Mouse button down gesture. Instances have two slots:
mods - a sequence of modifiers; see Keyboard gestures
# - a mouse button number, or f indicating no specific button is expected


Examples
T{ button-down f f 1 } T{ button-down }


Definition
IN: ui.gestures

TUPLE: button-down mods # ;


Methods
USING: accessors kernel make math.parser ui.gestures ;

M: button-down gesture>string
[
dup mods>> modifiers>string % "Press Button" % #>>
[ " " % # ] when*
] "" make ;