gui
gui copied to clipboard
mouse-event% vs get-mouse-state issues
Following the results gathered from https://racket.discourse.group/t/help-me-gather-keystrokes-and-mouse-events-for-varied-platforms/307/7
On Mac, there are several issues:
-
controlisn't reported in themouse-event%, while it is reported byget-mouse-state. -
get-mouse-state reports
leftbutton instead ofrightormiddleExample of such discrepancies:- mouse-event%:
right:shift:meta:right-downget-mouse-state:(914 602 left shift meta control) - mouse-event%:
right:right-downget-mouse-state:(614 435 left control)
- mouse-event%:
-
Some Mac users reported that modifiers are not picked at all with mouse events
On Windows, things are mostly ok except that meta or alt are not always reported in the mouse-event%. Otherwise, the event also reports meta while the state reports alt.
Example:
- mouse-event%:
control:shift:left-upget-mouse-state:(1878 456 shift control alt)
On Unix, the only issue I found is that the mouse-event% reports meta while the state reports alt.
Unfortunately I don't own a Mac or a Windows machine (only a Linux) so I can't really attempt to debug this. However, one can easily try it out with this:
raco pkg install racket-paint
racket -l- racket-paint/event-listener --mouse-state
Related issues: https://github.com/racket/gui/issues/236 https://github.com/racket/gui/issues/252
This issue has been mentioned on Racket Discussions. There might be relevant details there:
https://racket.discourse.group/t/help-me-gather-keystrokes-and-mouse-events-for-varied-platforms/307/8
Most tests were on Racket CS 8.3