Kode / Kha

Ultra-portable, high performance, open source multimedia framework.
http://kha.tech
zlib License
1.49k stars 174 forks source link

Detect eraser pen input rather than treating it as mouse input #1240

Closed 5Mixer closed 3 years ago

5Mixer commented 4 years ago

Currently only the 'pen' side of tablet pen input is detected. The eraser side is treated as mouse input. In terms of API, the eraser should probably register as a second pen, as the get system already makes that easy. Assuming 0 is pen and 1 is eraser doesn't sound great though - perhaps an eraser attribute would have to be added.

Will require work at a lower level than Kha - if you'd like me to open this on the Kinc side, or if it is out of scope, please let me know. Thanks for all your work Robert!

RobDangerous commented 4 years ago

Hey, Kinc is not lower level than Kha. The question is - is this just about the C/C++ targets, then it would make sense to move this issue to Kinc.

5Mixer commented 4 years ago

You're right - I've been looking into Kinc, and it does have a similar API. No g2 though! :smile: I've opened the issue on the Kinc side. https://github.com/Kode/Kinc/issues/551 If it is eventually implemented on that side, the API will still need to be updated here.

RobDangerous commented 4 years ago

G2 is in there, too: https://github.com/Kode/Kinc/tree/master/Sources/Kore/Graphics2 - just hasn't been brought over to the new C API yet.

5Mixer commented 3 years ago

Kinc now has eraser callbacks that are implemented on linux. Kha can now have this added either through a second Pen entry with an eraser flag, or a more explicit eraser API. It could also make sense to have stylus' and their erasers logically linked, for instance with get allowing for access to the eraser and stylus of the one pen.

Tagging @luboslenco as this may be of interest, according to Rob :)