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

Request: HID Touchscreen for CH552 #3

Closed
nelsonjchen opened this issue Jan 7, 2024 · 17 comments · Fixed by #5
Closed

Request: HID Touchscreen for CH552 #3

nelsonjchen opened this issue Jan 7, 2024 · 17 comments · Fixed by #5

Comments

@nelsonjchen
Copy link
Contributor

nelsonjchen commented Jan 7, 2024

I've been using and hacking on https://github.com/biemster/3keys_1knob, a derivative of some of your work on Macropads for some cheap AliExpress keyboards.

I see that there's an HID mouse example. That is very neat but it only allows relative movements. I'm interested in sending touchscreen commands. There can be certain UIs that aren't friendly to mouses but are to touchscreens.

I have not been able to hack biemster's 3keys_1knob to the point where the Linux multitouch module is happy. I have been hacking the files in there, but I can't say I know exactly what I'm doing. I got it to the point that Linux knows to load multitouch to it but it's still pretty unhappy and multitouch in dmesg says it "can't get feature 0" or whatever that means. Not sure how I'm messing up the report descriptor.

I see you've been making changes to the templates for CH552. I'm probably going to start from scratch with the updated bases and try again to see if I can make HID Touchscreen "work" at rest without the kernel complaining.

Anyway, a HID touchscreen example that's compatible with Linux multitouch and possibly Windows 8+ for more users would be very much appreciated!

@nelsonjchen
Copy link
Contributor Author

Arduino prior art:

https://github.com/NicoHood/HID/pull/297/files

@nelsonjchen nelsonjchen changed the title Request: HID Touchscreen Request: HID Touchscreen for CH552 Jan 7, 2024
@wagiminator
Copy link
Owner

That sounds like an interesting project. Unfortunately, I've never worked with touchscreens before, so I can't help you straight away. The updated templates do not fix any errors or add any new features. They are just slightly optimized and save about 100 bytes of code.

@nelsonjchen
Copy link
Contributor Author

Thanks for your response. I'll continue to keep hacking. If I got something going, I'll be sure to share.

@wagiminator
Copy link
Owner

I'm keeping my fingers crossed for you and I'm looking forward to the result!

@nelsonjchen
Copy link
Contributor Author

I bought a touchscreen off Amazon to compare/steal/capture how it interacts as a touchscreen.

It has a CH554T that talks/makes a touchscreen. Can't find the source though. Hmm.

@nelsonjchen
Copy link
Contributor Author

Possible source. https://github.com/Remychou/usb-touchsreen. Messy, is the license real, but possibly a good reference and it's likely transformative as we're trying to get it to be a cleaner/SDCC implementation here.

@wagiminator
Copy link
Owner

That looks promising.

@nelsonjchen
Copy link
Contributor Author

Bah the GitHub reply displayed twice in GitHub mobile and I accidentally deleted it.

Anyway, quick summary is the hacking I've been doing seems to cause interrupt troubles. Will rebase to the template to try to sort it out.

Also, not sure if my compilation environment is making something that causes this as well.

@nelsonjchen
Copy link
Contributor Author

Haven't had much success. Life has been busy but what time I've had with it hasn't been too great. I've decided to go and rebase atop the newest templates and do a hello world with a mouse jiggler on my setup to make sure I can even send reports if necessary.

I can get the LED on my development board to blink, that's great. However, any calls to mouse_move afterwards seem to cause the board to lock up or something. Extremely, extremely frustrating. I'm not sure if it's an issue with SDCC either.

@nelsonjchen
Copy link
Contributor Author

It took me forever, especially with life stuff, but i have a small hardcoded hello world going now. 😁

https://github.com/nelsonjchen/ch552-touch-play

It touches on a loop.

I need to get my use case going first and foremost and then look to see how to extract it out to a nice PR to this repo someday.

@nelsonjchen
Copy link
Contributor Author

PXL_20240416_035946480.mp4

Hardcoded use case so far so good 😄

@wagiminator
Copy link
Owner

Great!!!

@nelsonjchen
Copy link
Contributor Author

Works for my use case with the comma three. But not my girlfriend's Windows laptop after going to 2 fingers and above for some reason.

Will continue to polish and hopefully PR a working Windows compatible template implementation.

https://youtube.com/shorts/-VjC_3XHyv0?si=vSlsnMmhSsbk-Hsw

@nelsonjchen
Copy link
Contributor Author

"Productized" repo out.

https://github.com/nelsonjchen/c3-touchkey-keyboard

@wagiminator
Copy link
Owner

Fantastic, this really turned out to be a cool project. Congratulations!!!

@nelsonjchen
Copy link
Contributor Author

Thanks! You and @biemster were the real MVPs!

@nelsonjchen
Copy link
Contributor Author

https://github.com/nelsonjchen/c3-faux-touch-keyboard/releases/tag/0.0.4 released with a refactor candidate/test for future upstreaming. Am traveling next week for the following two weeks.

Will probably go for MVP with the API for now for upstreaming when back

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 a pull request may close this issue.

2 participants