 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays assocs kernel math math.order models
-namespaces make sequences words strings system hashtables
-math.parser math.vectors classes.tuple classes boxes calendar
-alarms combinators sets columns fry deques ui.gadgets
-ui.gadgets.private unicode.case combinators.short-circuit call ;
+namespaces make sequences words strings system hashtables math.parser
+math.vectors classes.tuple classes boxes calendar alarms combinators
+sets columns fry deques ui.gadgets ui.gadgets.private unicode.case
+unicode.categories combinators.short-circuit call ;
 IN: ui.gestures
 
 GENERIC: handle-gesture ( gesture gadget -- ? )


M: key-down gesture>string
    [ mods>> ] [ sym>> ] bi
    dup { [ length 1 = ] [ upper? ] } 1&&
    [ [ S+ prefix ] dip ] [ >upper ] if
    [ modifiers>string ] dip append ;

M: button-up gesture>string


: multi-click? ( button -- ? )
    {
        [ multi-click-timeout? ]
        [ multi-click-button? ]
        [ multi-click-position? ]
    } 0&& nip ;

: update-click# ( button -- )
    global [
