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

Feature request: Support Cintiq/other tablet pens #1454

Open
chnoma opened this issue Dec 30, 2024 · 5 comments
Open

Feature request: Support Cintiq/other tablet pens #1454

chnoma opened this issue Dec 30, 2024 · 5 comments
Labels
enhancement New feature or request PRs welcome jtroo has no plans to work on this at present, but PRs are welcome

Comments

@chnoma
Copy link

chnoma commented Dec 30, 2024

Is your feature request related to a problem? Please describe.

Attempting to remap a Cintiq pen doesn't work; the input seems to stop working entirely.

Describe the solution you'd like.

The ability to remap tablet pens without dropping input

Describe alternatives you've considered.

Right now I'm running Kanata alongside Input-remapper, but it creates a new device each time it detects a pen, so it's not great. As far as I can tell, there is no viable way to do this with Kanata right now.

Additional context

I don't know that the pen events actually map to existing ones in Kanata to begin with. I think they're Libinput events.
If I could get some pointers on where to start I would be more than happy to try implementing this myself.

Thank you

@chnoma chnoma added the enhancement New feature or request label Dec 30, 2024
@jtroo
Copy link
Owner

jtroo commented Dec 31, 2024

The file to inspect would likely be: https://github.com/jtroo/kanata/blob/main/src/oskbd/linux.rs

You can add the --debug flag to get more logging output when running Kanata.

@jtroo jtroo added the PRs welcome jtroo has no plans to work on this at present, but PRs are welcome label Jan 1, 2025
@chnoma
Copy link
Author

chnoma commented Jan 1, 2025

I was able to get the position of the pen passed through by adding hardcoded EV_ABS specifications in KbdOut::new, but it seems to kill the ability to send regular keys. Not only that, but it also looks like it would need values passed from the input device to the virtual output device, which doesn't seem to line up with the architecture of kanata.

Would it be reasonable to think that this would need some kind of check and separate handler upon initialization? I really like this software and would like to make it work, but I don't wanna go down some crazy rabbit hole on a bad premise, or against the core idea of the software.

Thanks for your time

@jtroo
Copy link
Owner

jtroo commented Jan 1, 2025

From an IO perspective, currently Kanata presents as a single device using uinput, but it can choose to have multiple uinput device instances to have the separate EV_ABS events go there.

@chnoma
Copy link
Author

chnoma commented Jan 1, 2025

I'll do some more reading, thanks!

@rszyma
Copy link
Contributor

rszyma commented Jan 5, 2025

Side note: having separate device for tablet-related stuff is probably also required for implementing setmouse on linux on evdev level - see my previous comment on this topic: #623 (comment). An implementation of that that works for me, although written in C: https://github.com/sciboy12/Abs-C

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PRs welcome jtroo has no plans to work on this at present, but PRs are welcome
Projects
None yet
Development

No branches or pull requests

3 participants