-
Notifications
You must be signed in to change notification settings - Fork 1
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
Pen tilt support #3
Comments
Here is ithc dump from my uogic pen with tilt support. |
SLS with quo's ithc+ quo's iptsd on Ubuntu 22.04LTS on Surface Kernel Tilt from ~center to ~180 degree (I have avoid the bottom part of pen touch or hover the screen so the result wont be too much difficult, also I avoid soft pressing of bottom button as it may alter the result such as middle click (#5 ) for <5 seconds |
Thanks! Your pens are definitely sending a lot more data than my pen. I've plotted the total magnitudes for the rows of the various DFT packet types, and tried to find some patterns.
So unfortunately it's not immediately obvious how the tilt is encoded. I don't see anything that's obviously frequency modulated. Since the pens already appear to contain a second transmitter for the eraser, it could even be something like: there's another transmitter slightly behind the main transmitter, and you can determine its position relative to the screen and then combine with the position of the main transmitter to determine pen orientation... |
I've cleaned up some of my parsing code and uploaded it here: If anyone wants to have a look at the tilt data themselves, you can run the parser with the dft option: As you move the pen around near the screen, you should see a colorful display of the pen data: You will probably have to fullscreen your terminal or decrease the font size to see everything correctly. For example, on the right side of the output, the first six digits after "11x" (and repeated after "y") represent the pen tip pressure. Please let me know if you spot anything that correlates strongly with the tilt angle (or if you notice anything else interesting). |
Testing and Analysis progress ( T: testing result created (tick marked): both testing gathering and analysis done )
Test analysis will be here |
Closer inspection of the DFT bins shows that some of the data does actually have a different position. So it seems there is another transmitter in the pens. The following table shows the transmitter for each DFT row (a=primary, b=secondary):
Based on this, I've added position and tilt decoding to surface-parser.py. The parser will now show four numbers before "7x". These represent x position, y position, x tilt, and y tilt (where tilt is just the offset between the two transmitter positions). If all pens have the exact same distance between the two transmitters, calculating tilt angles from the shift values is straightforward. To test this, we need to get tilt values for various angles from a few different pens. So if anyone would like to help, please do the following:
|
This this the output of the parser for each movements/inclinations: |
Thanks! Values seem be approximately in the 95 to 110 range. So that would mean the distance between the transmitters is around 6 mm: (95...110) / 100 / sin(45°) * 259.78 mm / 63 = 5.54...6.42 mm |
Implemented in linux-surface@b941da4 |
Tilt is currently not implemented, because I don't have a pen with tilt support.
If we get some data captures from pens with tilt support, we can probably figure out the format.
To capture the data from the ithc driver, run
sudo cat /dev/ithc > ithc.dat
(you don't have to stop iptsd). Then put the pen in the center of the screen and tilt it at various angles. Afterwards Ctrl+C to stop thecat
command, and you should have an ithc.dat which is several megabytes large. Please zip the file and attach it here, and please also say which Surface device and which pen you're using.The text was updated successfully, but these errors were encountered: