{ $examples { $code "T{ motion }" } } ;
HELP: drag
-{ $class-description "Mouse drag gesture. The " { $link drag-# } " slot is either set to a mouse button number, or " { $link f } " indicating no specific button is expected." } ;
+{ $class-description "Mouse drag gesture. The " { $snippet "#" } " slot is either set to a mouse button number, or " { $link f } " indicating no specific button is expected." } ;
HELP: button-up
{ $class-description "Mouse button up gesture. Instances have two slots:"
{ $list
- { { $link button-up-mods } " - a sequence of modifiers; see " { $link "keyboard-gestures" } }
- { { $link button-up-# } " - a mouse button number, or " { $link f } " indicating no specific button is expected" }
+ { { $snippet "mods" } " - a sequence of modifiers; see " { $link "keyboard-gestures" } }
+ { { $snippet "#" } " - a mouse button number, or " { $link f } " indicating no specific button is expected" }
}
}
{ $examples { $code "T{ button-up f f 1 }" "T{ button-up }" } } ;
HELP: button-down
{ $class-description "Mouse button down gesture. Instances have two slots:"
{ $list
- { { $link button-down-mods } " - a sequence of modifiers; see " { $link "keyboard-gestures" } }
- { { $link button-down-# } " - a mouse button number, or " { $link f } " indicating no specific button is expected" }
+ { { $snippet "mods" } " - a sequence of modifiers; see " { $link "keyboard-gestures" } }
+ { { $snippet "#" } " - a mouse button number, or " { $link f } " indicating no specific button is expected" }
}
}
{ $examples { $code "T{ button-down f f 1 }" "T{ button-down }" } } ;
HELP: key-down
{ $class-description "Key down gesture. Instances have two slots:"
{ $list
- { { $link key-down-mods } " - a sequence of modifiers; see " { $link "keyboard-gestures" } }
- { { $link key-down-sym } " - a string denoting the key pressed; see " { $link "keyboard-gestures" } }
+ { { $snippet "mods" } " - a sequence of modifiers; see " { $link "keyboard-gestures" } }
+ { { $snippet "sym" } " - a string denoting the key pressed; see " { $link "keyboard-gestures" } }
}
}
{ $examples { $code "T{ key-down f { C+ } \"a\" }" "T{ key-down f f \"TAB\" }" } } ;
HELP: key-up
{ $class-description "Key up gesture. Instances have two slots:"
{ $list
- { { $link key-up-mods } " - a sequence of modifiers; see " { $link "keyboard-gestures" } }
- { { $link key-up-sym } " - a string denoting the key pressed; see " { $link "keyboard-gestures" } }
+ { { $snippet "mods" } " - a sequence of modifiers; see " { $link "keyboard-gestures" } }
+ { { $snippet "sym" } " - a string denoting the key pressed; see " { $link "keyboard-gestures" } }
}
}
{ $examples { $code "T{ key-up f { C+ } \"a\" }" "T{ key-up f f \"TAB\" }" } } ;
: send-button-down ( gesture loc world -- )
move-hand
start-drag-timer
- dup button-down-#
+ dup #>>
dup update-click# hand-buttons get-global push
update-clicked
button-gesture ;
: send-button-up ( gesture loc world -- )
move-hand
- dup button-up-# hand-buttons get-global delete
+ dup #>> hand-buttons get-global delete
stop-drag-timer
button-gesture ;
[ name>> ] map concat >string ;
M: key-down gesture>string
- dup key-down-mods modifiers>string
- swap key-down-sym append ;
+ dup mods>> modifiers>string
+ swap sym>> append ;
M: button-up gesture>string
[
- dup button-up-mods modifiers>string %
+ dup mods>> modifiers>string %
"Click Button" %
- button-up-# [ " " % # ] when*
+ #>> [ " " % # ] when*
] "" make ;
M: button-down gesture>string
[
- dup button-down-mods modifiers>string %
+ dup mods>> modifiers>string %
"Press Button" %
- button-down-# [ " " % # ] when*
+ #>> [ " " % # ] when*
] "" make ;
M: left-action gesture>string drop "Swipe left" ;