Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pen input #262

Open
TheMode opened this issue Feb 6, 2023 · 2 comments
Open

Pen input #262

TheMode opened this issue Feb 6, 2023 · 2 comments

Comments

@TheMode
Copy link

TheMode commented Feb 6, 2023

I am currently experimenting with a drawing app, and the seemingly lack of API for pen inputs make it harder than it can be (should at least allow the software to differentiate touch from pen).

I suggest adding support for these APIs:

@tonsky
Copy link
Collaborator

tonsky commented Feb 7, 2023

I’d be happy to have these. PRs are welcome!

@TheMode
Copy link
Author

TheMode commented Feb 8, 2023

I have at least found on macos (the platform I am mostly interested in), pen inputs are sent as mouse with additional metadata
Mouse down:

NSEvent: type=LMouseDown loc=(175.711,206.383) time=37530.5 flags=0 win=0x154e06e30 winNum=5683 ctxt=0x0 evNum=4888 click=1 buttonNumber=0 pressure=1 deviceID:0x200000000000027 subtype=NSEventSubtypeTouch

Pen down:

NSEvent: type=LMouseDown loc=(364,130.52) time=37534.2 flags=0 win=0x154e06e30 winNum=5683 ctxt=0x0 evNum=1 click=1 buttonNumber=0 pressure=0.0784314 deviceID:0x250b subtype=NSEventSubtypeTabletPoint deviceID=9483 x=-578 y=518 z=0 buttons=0x1 pressure=0.078431 tilt={0.43333231604968414, -0.077761162144840842} rotation=0.000000 tangentialPressure=0.000000 vendor1-3=(0, 0, 0)

I assume that the best way to include it in the current API would be to take a similar approach and append optional metadata to the mouse events, like a StylusMeta/TabletMeta structure.

I am however not familiar enough with the code base to do such change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants