-
Notifications
You must be signed in to change notification settings - Fork 12
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
Translate touchpad events to mouse events? #3
Comments
Great suggestion! This one is a bit difficult to implement for me because none of the devices I regularly use have a touchpad, and from a cursory look on the documentation it appears that there are several classes of touchpads with different protocols as well. Especially correctly handling multi-touch devices looks like an obstacle. I do have a pentablet, which may or may not be too different from a touchpad. In the last few commits (current commit: 80bd2de) I have added a toy The following script converts my pentablet to a mouse quite nicely. The problem is the amount of device-specific fiddling required:
The The difficult part of this feature is going to be (1) finding enough devices to get a good overview of how touchpads generally work and be able to properly test my implementations, and (2) designing an interface to manipulate them that is simple enough that the average user can understand it. |
I added some support for relative value maps to the latest development version. For example:
will map each EV_ABS, ABS_X event to a EV_REL, REL_X event with a value equal to 0.1 times the difference between the current and last value reported for EV_ABS, ABS_X. This doesn't quite solve the touchpad-to-mouse mapping issue yet, but it is an useful tool for this problem space. As usual, all features added to the the main git branch are subject to change until they become part of a stable release. (Yes, I am aware that a stable 1.3 release is overdue.) |
I have removed I have also renamed
My inner mathematician thinks that either the variables should be a single letter long, or there should be an explicit multiplication symbol like The good news is that I have found a device with a touchpad, so I can now test things. It seems to work about the same as my pentablet, except that it uses BTN_TOOL_FINGER instead of BTN_TOOL_PEN, and emits EV_ABS_MT events in addition to the regular EV_ABS. The biggest issue that does not seem easy to handle is gesture interpreting. If all you want to do is translate finger movements to a cursor movement, that seems reachable with relative value maps + some syntactic sugar for toggles. However, gestures like "put two fingers on the touchpad and move them down to scroll" are a different beast. I could either try to integrate with (a patched version of) |
Greetings! I am the owner of the Thinkpad x1 Tablet gen 3 device OS = ArchLinux The touchscreen is working out of the box, but in some applications, such as Intellij Idea, it does not want to work That is, line selection does not work, right-click emulation, two-finger scrolling, the cursor is not displayed I came up with the idea that all these problems would be solved if the touchscreen worked like a touchpad I was looking for ways to configure via libinput, libwacom, sway-input, I found different mappers that make up a reaction to gestures from the touchscreen, but these are gestures, not mapping finger movements to cursor movements Can I use evsieve to make the touchscreen work like a touchpad? For example, somehow collect events from the touchscreen device and match the events of the virtual mouse device ydotool libinput splits a physical device into two, one of them is of the tablet type, the other is touch Events appear in /dev/input/... from a touch device |
I don't have any touchscreen and touchpad to test myself, but I would imagine that the events emitted by a touchscreen and touchpad to be pretty similar. It seems that libinput allows you to override the type of an input device by changing the udev properties of the device. Maybe changing the type of your touchscreen to ID_INPUT_TOUCHPAD using udev will solve your problem? (Example udev rules available in posted link. I imagine that you will have to reboot your system after making changes to the udev configuration to make your changes take effect.) |
So currently, touchpad support is lacking in laptop virtual machines. Translating touchpad events to mouse events would be useful for finally giving the touchpad adequate functionality.
I understand this is more complex than usual, but I think this would be a common enough of a use case for all laptop virtual machines. It'd be nice to be able to solely use the touchpad instead of having to carry around a mouse while moving around with a laptop.
The text was updated successfully, but these errors were encountered: