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

feat(Touchscreen): add support for generic touchscreen devices #272

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ShadowApex
Copy link
Contributor

This change adds support for generic touchscreen source devices. This change also adds the config section of a source device to allow defining arbitrary configuration of that captured source device. i.e. in the case of touchscreens, it can allow the source driver to translate touches based on the orientation of the touchscreen.

@ShadowApex ShadowApex requested a review from pastaq January 28, 2025 21:48
@ShadowApex ShadowApex force-pushed the shadowapex/generic-touchscreen branch 2 times, most recently from 776e188 to c0406fc Compare January 29, 2025 01:21
@pastaq
Copy link
Contributor

pastaq commented Jan 29, 2025

I'll test this when I get back.

@ShadowApex ShadowApex force-pushed the shadowapex/generic-touchscreen branch 4 times, most recently from 07534cb to f2ba72e Compare January 29, 2025 21:38
@ShadowApex ShadowApex marked this pull request as ready for review January 29, 2025 21:39
src/config/mod.rs Outdated Show resolved Hide resolved
config:
touchscreen:
orientation: "right"
width: 1280
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be better to use an aspect ratio here and scale it based in the true resolution. We would need to detect that

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left width and height here to allow users to override the width/height of the virtual touchscreen that gets created, but I have updated this PR to now query the source touchscreen for its size if these are not defined.

src/input/source/evdev/touchscreen.rs Show resolved Hide resolved
@ShadowApex ShadowApex force-pushed the shadowapex/generic-touchscreen branch from f2ba72e to 3aed117 Compare January 29, 2025 21:50
@ShadowApex ShadowApex force-pushed the shadowapex/generic-touchscreen branch from 3aed117 to 479744d Compare January 30, 2025 19:46
@ShadowApex ShadowApex requested a review from pastaq January 30, 2025 19:52
@pastaq
Copy link
Contributor

pastaq commented Jan 30, 2025

I'm going to test this on my flip to see if it can fix the bad touchscreen input

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

Successfully merging this pull request may close these issues.

2 participants