Skip to content

Commit

Permalink
drflux mouse button release fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborpapp committed Aug 20, 2011
1 parent 0626ad3 commit 564ddad
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions modules/scheme/drflux.ss
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
(all-from-out "fluxus.ss"))

(define fluxus-collects-location (path->string (car (cdr (current-library-collection-paths)))))
(define fluxus-version "0.16")
(define fluxus-version "0.18")

(define fluxus-canvas%
(class* canvas% ()
Expand All @@ -48,10 +48,20 @@

; mouse
(define/override (on-event event)
(let* ((button (cond
((send event get-left-down) 0)
((send event get-middle-down) 1)
((send event get-right-down) 2)
(let* ((type (send event get-event-type))
(button (cond
((or (send event get-left-down)
(eq? type 'left-up)
(eq? type 'left-down))
0)
((or (send event get-middle-down)
(eq? type 'middle-down)
(eq? type 'middle-up))
1)
((or (send event get-right-down)
(eq? type 'right-down)
(eq? type 'right-up))
2)
(else -1)))
(state (cond
((send event button-down? 'any) 0)
Expand Down

0 comments on commit 564ddad

Please sign in to comment.