]> gitweb.factorcode.org Git - factor.git/commitdiff
use nano-count instead of timestamps for mouse clicks
authorDoug Coleman <doug.coleman@gmail.com>
Fri, 20 Nov 2009 00:23:29 +0000 (18:23 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Fri, 20 Nov 2009 00:23:29 +0000 (18:23 -0600)
basis/ui/gestures/gestures.factor

index 2f1de2f5c6e583f147c3fdc3665c97c317d8d6c5..59036f90f070f446ed79b8bbdd46cb4f3f2f55f3 100644 (file)
@@ -156,7 +156,7 @@ SYMBOL: hand-click#
 SYMBOL: hand-last-button
 SYMBOL: hand-last-time
 0 hand-last-button set-global
-<zero> hand-last-time set-global
+nano-count hand-last-time set-global
 
 SYMBOL: hand-buttons
 V{ } clone hand-buttons set-global
@@ -246,7 +246,8 @@ SYMBOL: drag-timer
     hand-click-loc get-global swap screen-loc v- ;
 
 : multi-click-timeout? ( -- ? )
-    now hand-last-time get time- double-click-timeout get before=? ;
+    nano-count hand-last-time get - nanoseconds
+    double-click-timeout get before=? ;
 
 : multi-click-button? ( button -- button ? )
     dup hand-last-button get = ;
@@ -269,7 +270,7 @@ SYMBOL: drag-timer
             1 hand-click# set
         ] if
         hand-last-button set
-        now hand-last-time set
+        nano-count hand-last-time set
     ] bind ;
 
 : update-clicked ( -- )