Update old accessors from 'ui.gestures'
parent
e27d6b31d2
commit
401597a387
|
@ -30,13 +30,13 @@ HELP: motion
|
|||
{ $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 }" } } ;
|
||||
|
@ -44,8 +44,8 @@ HELP: 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 }" } } ;
|
||||
|
@ -109,8 +109,8 @@ HELP: S+
|
|||
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\" }" } } ;
|
||||
|
@ -118,8 +118,8 @@ HELP: key-down
|
|||
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\" }" } } ;
|
||||
|
|
|
@ -226,14 +226,14 @@ SYMBOL: drag-timer
|
|||
: 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 ;
|
||||
|
||||
|
@ -261,21 +261,21 @@ GENERIC: gesture>string ( gesture -- string/f )
|
|||
[ 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" ;
|
||||
|
|
Loading…
Reference in New Issue