Use trackpads as mouse inputs on Linux - #5
Conversation
LennardKittner
left a comment
There was a problem hiding this comment.
Looks good, thanks :)
To mimic the Steam Controller's mouse mode more closely, I would suggest adding:
left click = Steam button + right trigger
right click = Stream button + left trigger
(You can check out
for an example on how this was done for similar button combinations)But I am happy to merge the PR as is. So let me know if you are interested in implementing this; otherwise, I would merge your PR and add this later myself.
|
Sure, I'll give it a go |
|
hmmm, I get the feeling it would be better to have holding the home button change the virtual controller behaviour, rather than pushing more events into the queue. You wouldn't want the virtual controller outputting L2/R2 events at all while in the home-button-held layout |
|
Good point. I think it makes sense to suppress button presses while the steam button is pressed. But then we also have to release all buttons when the steam button is pressed or still forward the release of buttons. However, I would not move this into the virtual controller because then we would have to implement this behavior for each system separately. Instead, we should keep the suppression and button combination handling in the Steam controller struct or maybe move it into |
|
Maybe we should leave this PR as is and I'll open another with some ideas for how to implement the alt layout |
|
Ok sounds good :) |
This adds a second uinput device on Linux which acts as a mouse input, controlled by the left and right trackpads.
I tried adding the events directly to the controller device but it completely messed up how the virtual controller was registered on my system.
Scroll is implemented in 2D, but could easily be changed to the 1D circle input that steam input uses.
Both trackpads attempt to accumulate fractional error so that sub-integer movements aren't lost.
Position tracking is reset every time a touch event is received to prevent sudden jumps.