Handbook
Glossary
key-down
Factor handbook
»
UI framework
»
Implementing new gadgets
»
UI gestures
»
Keyboard gestures
Next:
key-up
Vocabulary
ui
.
gestures
Class description
Key down gesture. Instances have two slots:
mods
a sequence of modifiers; see
Keyboard gestures
sym
a string denoting the key pressed; see
Keyboard gestures
Examples
T{ key-down f { C+ } "a" } T{ key-down f f "TAB" }
Definition
IN:
ui.gestures
TUPLE:
key-down
<
key-gesture
;
Methods
USING:
accessors
ascii
combinators
combinators.short-circuit
kernel
sequences
ui.gestures
;
M:
key-down
gesture>string
[
mods>>
]
[
sym>>
]
bi
{
{
[
dup
{
[
length
1
=
]
[
first
LETTER?
]
}
1&&
]
[
[
S+
prefix
]
dip
]
}
{
[
dup
" "
=
]
[
drop
"SPACE"
]
}
[
]
}
cond
[
modifiers>string
]
[
keysym>string
]
bi*
append
;