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

Support for graphic tablet/stylus/pen events? #7278

Open
Chemrat opened this issue Oct 13, 2018 · 7 comments
Open

Support for graphic tablet/stylus/pen events? #7278

Chemrat opened this issue Oct 13, 2018 · 7 comments

Comments

@Chemrat
Copy link

Chemrat commented Oct 13, 2018

I've skimmed through C++ HTML5 API and seems like there is API for mouse and touch events, but not for pen events (pointer events with tilt and pressure)

@stale
Copy link

stale bot commented Oct 13, 2019

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 7 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Oct 13, 2019
@stale stale bot closed this as completed Oct 20, 2019
@ec1oud
Copy link

ec1oud commented Jul 29, 2020

Given that browsers do support them, I think emscripten should.

https://www.w3.org/TR/pointerevents2/#dom-pointerevent-pressure

Qt's wasm plugin uses emscripten, and Qt supports pen tablets. So this would potentially pave the way for Qt-based drawing applications to be portable not only between desktop and mobile operating systems, but also to the browser.

@kripken kripken reopened this Jul 29, 2020
@stale stale bot removed the wontfix label Jul 29, 2020
@stale
Copy link

stale bot commented Jul 30, 2021

This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant.

@stale stale bot added the wontfix label Jul 30, 2021
@stale stale bot closed this as completed Sep 4, 2021
@Lemovision
Copy link

Hi is it possible to have a look at this please?
I also very much need this feature for a drawing app

@kripken kripken reopened this Nov 2, 2021
@stale stale bot removed the wontfix label Nov 2, 2021
@digitalsignalperson
Copy link

@icculus
Copy link
Contributor

icculus commented Aug 10, 2024

SDL3 now has SDL_pen.h as well

It does, and we've just cut this API down dramatically so we could reasonably target lots more platforms, including Emscripten.

What SDL3 needs from Emscripten is access to Pointer Events, and I suppose we could wedge in some Javascript code to hook into the browser via EM_ASM, but it would be nicer if there were an equivalent of emscripten_set_mousedown_callback (etc) for these, as that's what SDL uses for everything else. Among other reasons, the Emscripten functions do a lot of stuff behind the scenes I'm not really qualified to manage, and don't really understand without a background in Emscripten internals magic. :)

Although I suppose that a Pointer Events equivalent would probably be mostly this same code with different details?

@icculus
Copy link
Contributor

icculus commented Aug 12, 2024

I implemented this today in SDL3 using Javascript directly, here, but if would still be nice if this were to have the same Emscripten APIs that mouse/touch already use.

(A demo of the SDL3 implementation is here if you have a stylus/pen that works with your browser.)

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

No branches or pull requests

6 participants