racket / racket/gui

mouse-event% vs get-mouse-state issues

Open
#255 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Racket
Stars
68
Forks
82
PR merge metrics
No merged PRs in 30d

Description

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:

  • control isn't reported in the mouse-event%, while it is reported by get-mouse-state.

  • get-mouse-state reports left button instead of right or middle
    Example of such discrepancies:

    • mouse-event%: right:shift:meta:right-down
      get-mouse-state: (914 602 left shift meta control)
    • mouse-event%: right:right-down
      get-mouse-state: (614 435 left control)
  • 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-up
    get-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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running racket -l- racket-paint/event-listener --mouse-state after installing racket-paint, then compare mouse-event% reports with get-mouse-state on Mac, Windows, and Unix. Investigate the platform-specific modifier and mouse-button discrepancies described in the issue; done means the two APIs report consistent state across the tested platforms.

Written by the indexing model from the issue text.

Assessment

Domain
desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.