ui.gestures: fix gesture docs, #1509

db4
Björn Lindqvist 2015-12-01 11:01:34 +01:00
parent 763b892a1d
commit 43f2592d1b
2 changed files with 24 additions and 3 deletions

View File

@ -32,10 +32,27 @@ IN: ui.backend.gtk.tests
{ is_modifier 0 }
} ;
: gdk-space-key-press-event ( -- event )
S{ GdkEventKey
{ type 8 }
{ window ALIEN: 1b66360 }
{ send_event 0 }
{ time 28246628 }
{ state 0 }
{ keyval 32 }
{ length 0 }
{ string ALIEN: 20233b0 }
{ hardware_keycode 64 }
{ group 0 }
{ is_modifier 1 }
} ;
{
T{ key-down f f "F2" }
T{ key-up f f "H" }
T{ key-down f f " " }
} [
gdk-key-press-event key-event>gesture
gdk-key-release-event key-event>gesture
gdk-space-key-press-event key-event>gesture
] unit-test

View File

@ -1,5 +1,5 @@
USING: ui.gadgets help.markup help.syntax
hashtables strings kernel system ;
USING: hashtables help.markup help.syntax kernel strings system
ui.gadgets ui.gadgets.worlds ;
IN: ui.gestures
HELP: set-gestures
@ -234,6 +234,10 @@ HELP: up-action
HELP: down-action
{ $class-description "Gesture sent when the user performs a multi-touch three-finger swipe down." } ;
HELP: world-focus
{ $values { "world" world } { "gadget" gadget } }
{ $description "Gets the gadget that is in focus for the world." } ;
HELP: zoom-in-action
{ $class-description "Gesture sent when the user performs a multi-touch two-finger pinch in." } ;
@ -347,7 +351,7 @@ ARTICLE: "keyboard-gestures" "Keyboard gestures"
}
"The " { $link S+ } " modifier is only ever used with the above action keys; alphanumeric input input with the shift key is delivered without the " { $link S+ } " modifier set, instead the input itself is upper case. For example, the gesture corresponding to " { $snippet "s" } " with the Control and Shift keys pressed is presented as "
{ $code "T{ key-down f { C+ } \"S\" }" }
"The " { $snippet "RET" } ", " { $snippet "TAB" } " and " { $snippet "SPACE" } " keys are never delivered in their literal form (" { $snippet "\"\\n\"" } ", " { $snippet "\"\\t\"" } " or " { $snippet "\" \"" } ")." ;
"The " { $snippet "RET" } " and " { $snippet "TAB" } " keys are never delivered in their literal form (" { $snippet "\"\\n\"" } " and " { $snippet "\"\\t\"" } ;
ARTICLE: "ui-user-input" "Free-form keyboard input"
"Whereas keyboard gestures are intended to be used for keyboard shortcuts, certain gadgets such as text fields need to accept free-form keyboard input. This can be done by implementing a generic word:"