efernau / rot8

screen rotation daemon
MIT License
109 stars 27 forks source link

Rotation is not applied to the stylus #59

Open Xwang1976 opened 9 months ago

Xwang1976 commented 9 months ago

I'm using rot8 under X calling it at startup with the following command rot8 --touchscreen 'WACF3200:00 29BD:1102'

When I rotate the device, the screen and the touch screen are correctly rotated, but the stylus is not.

This is the output of xinput list ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ VEN_0488:00 0488:1038 Mouse id=12 [slave pointer (2)] ⎜ ↳ VEN_0488:00 0488:1038 Touchpad id=13 [slave pointer (2)] ⎜ ↳ PS/2 Generic Mouse id=20 [slave pointer (2)] ⎜ ↳ WACF3200:00 29BD:1102 Stylus Pen (0xc025a28c) id=21 [slave pointer (2)] ⎜ ↳ WACF3200:00 29BD:1102 Stylus Eraser (0xc025a28c) id=22 [slave pointer (2)] ⎜ ↳ WACF3200:00 29BD:1102 id=9 [slave pointer (2)] ⎜ ↳ WACF3200:00 29BD:1102 UNKNOWN id=11 [slave pointer (2)] ⎜ ↳ WACF3200:00 29BD:1102 Stylus Pen (0xc0000000) id=23 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Video Bus id=6 [slave keyboard (3)] ↳ Power Button id=7 [slave keyboard (3)] ↳ Sleep Button id=8 [slave keyboard (3)] ↳ WACF3200:00 29BD:1102 Stylus id=10 [slave keyboard (3)] ↳ sof-soundwire Headset Jack id=14 [slave keyboard (3)] ↳ Intel HID events id=15 [slave keyboard (3)] ↳ Intel HID 5 button array id=16 [slave keyboard (3)] ↳ Dell Privacy Driver id=17 [slave keyboard (3)] ↳ Dell WMI hotkeys id=18 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=19 [slave keyboard (3)]

How can I have also the stylus rotated?

Xwang1976 commented 9 months ago

I've tried to run rot8 --touchscreen 'WACF3200:00 29BD:1102' 'WACF3200:00 29BD:1102 Stylus' 'WACF3200:00 29BD:1102'

These are the xinput list-props of the 3 input when the device is in landscape and then in portrait [andreak@D9330 ~]$ xinput list-props "WACF3200:00 29BD:1102" Device 'WACF3200:00 29BD:1102': Device Enabled (187): 1 Coordinate Transformation Matrix (189): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Rotation Angle (303): 0.000000 libinput Rotation Angle Default (304): 0.000000 libinput Calibration Matrix (322): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Calibration Matrix Default (323): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Send Events Modes Available (305): 1, 0 libinput Send Events Mode Enabled (306): 0, 0 libinput Send Events Mode Enabled Default (307): 0, 0 Device Node (308): "/dev/input/event8" Device Product ID (309): 10685, 4354 [andreak@D9330 ~]$ xinput list-props "WACF3200:00 29BD:1102 Stylus" Device 'WACF3200:00 29BD:1102 Stylus': Device Enabled (187): 1 Coordinate Transformation Matrix (189): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Calibration Matrix (322): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Calibration Matrix Default (323): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Send Events Modes Available (305): 1, 0 libinput Send Events Mode Enabled (306): 0, 0 libinput Send Events Mode Enabled Default (307): 0, 0 Device Node (308): "/dev/input/event9" Device Product ID (309): 10685, 4354 [andreak@D9330 ~]$ xinput list-props "WACF3200:00 29BD:1102 Stylus Pen (0xc025a28c)" Device 'WACF3200:00 29BD:1102 Stylus Pen (0xc025a28c)': Device Enabled (187): 1 Coordinate Transformation Matrix (189): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Send Events Modes Available (305): 1, 0 libinput Send Events Mode Enabled (306): 0, 0 libinput Send Events Mode Enabled Default (307): 0, 0 Device Node (308): "/dev/input/event9" Device Product ID (309): 10685, 4354 libinput Tablet Tool Pressurecurve (615): 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000, 1.000000 [andreak@D9330 ~]$ X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 131 (XInputExtension) Minor opcode of failed request: 57 () Serial number of failed request: 22 Current serial number in output stream: 23 [andreak@D9330 ~]$ X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 131 (XInputExtension) Minor opcode of failed request: 57 () Serial number of failed request: 22 Current serial number in output stream: 23 X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 131 (XInputExtension) Minor opcode of failed request: 57 () Serial number of failed request: 22 Current serial number in output stream: 23 [andreak@D9330 ~]$ xinput list-props "WACF3200:00 29BD:1102" Device 'WACF3200:00 29BD:1102': Device Enabled (187): 1 Coordinate Transformation Matrix (189): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Rotation Angle (303): 0.000000 libinput Rotation Angle Default (304): 0.000000 libinput Calibration Matrix (322): 0.000000, -1.000000, 1.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Calibration Matrix Default (323): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Send Events Modes Available (305): 1, 0 libinput Send Events Mode Enabled (306): 0, 0 libinput Send Events Mode Enabled Default (307): 0, 0 Device Node (308): "/dev/input/event8" Device Product ID (309): 10685, 4354 [andreak@D9330 ~]$ xinput list-props "WACF3200:00 29BD:1102 Stylus Pen (0xc025a28c)" Device 'WACF3200:00 29BD:1102 Stylus Pen (0xc025a28c)': Device Enabled (187): 1 Coordinate Transformation Matrix (189): 0.000000, -1.000000, 1.000000, 1.000000, 0.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Send Events Modes Available (305): 1, 0 libinput Send Events Mode Enabled (306): 0, 0 libinput Send Events Mode Enabled Default (307): 0, 0 Device Node (308): "/dev/input/event9" Device Product ID (309): 10685, 4354 libinput Tablet Tool Pressurecurve (615): 0.000000, 0.000000, 0.000000, 0.000000, 1.000000, 1.000000, 1.000000, 1.000000 [andreak@D9330 ~]$ xinput list-props "WACF3200:00 29BD:1102 Stylus" Device 'WACF3200:00 29BD:1102 Stylus': Device Enabled (187): 1 Coordinate Transformation Matrix (189): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Calibration Matrix (322): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Calibration Matrix Default (323): 1.000000, 0.000000, 0.000000, 0.000000, 1.000000, 0.000000, 0.000000, 0.000000, 1.000000 libinput Send Events Modes Available (305): 1, 0 libinput Send Events Mode Enabled (306): 0, 0 libinput Send Events Mode Enabled Default (307): 0, 0 Device Node (308): "/dev/input/event9" Device Product ID (309): 10685, 4354 [andreak@D9330 ~]$ X Error of failed request: BadMatch (invalid parameter attributes) Major opcode of failed request: 131 (XInputExtension) Minor opcode of failed request: 57 () Serial number of failed request: 22 Current serial number in output stream: 23

It seems that the WACF3200:00 29BD:1102 Stylus Pen (0xc025a28c) does have only the coordinate trasformation matrix properties and I do not know if that creates the problem.

Xwang1976 commented 9 months ago

With this command in autorun rot8 --touchscreen 'WACF3200:00 29BD:1102' 'WACF3200:00 29BD:1102 Stylus Pen (0xc025a28c)' It seems to work, but not the first time I rotate the device. It rotates the screen and the touchscreen, but not the stylus. But, if I rotate back the device and rotate again then everything seems to work.

efernau commented 9 months ago

hi @Xwang1976 ,

great that you use rot8. Which OS are you using and which rot8 version?

is this a hardware bug? It appears that the issue youre experiencing with the rot8 command might be related to the initial state of the stylus not being recognized correctly when you first rotate the device. If this is really the case, we could possibly build something, that checks the stat on injection and sets it to normal. Should we address something like this?

Xwang1976 commented 9 months ago

Hi, I'm using archlinux with rot8 installed using the rot8-git package in AUR. I don't think it is an hardware bug, because it doesn't happen under windows. I think it would be great if rot8 could solve the issue on Linux and if there is any test that I could do to help investigate the issue, please let me know.

Xwang1976 commented 8 months ago

Meantime the stylus has changed its name from WACF3200:00 29BD:1102 Stylus Pen (0xc025a28c) to WACF3200:00 29BD:1102 Stylus Pen (0xc0000000) so I've decided to use the id instead that the device names hoping that they will not change. I can confirm that first time I rotate to portrait, the stylus is not rotated, but by rotating back to landscape and again to portrait it get the correct orientation.