sc-controller icon indicating copy to clipboard operation
sc-controller copied to clipboard

Mouse / pen pressure emulation

Open Kalabasa opened this issue 6 years ago • 5 comments

I would like to map the analog trigger to a mouse axis (eg, REL_Z).

xinput test does not log any input event from trigger press.

The action is

mouse(Rels.REL_Z, 1)

Actually, the trigger does not work for any of the mouse axes (REL_X, REL_Y).

Use case is a paint program (GIMP actually) that accepts "pressure" input for painting. Trying to emulate pressure input through trigger pressure. I figured the gyro + touchpad + analog trigger would make for a good input device for digital painting, but I can't make it work.

Kalabasa avatar Dec 28 '17 20:12 Kalabasa

REL_Z is currently not supported as emulated mouse has only XY and wheel, but I can check if it can be added.

kozec avatar Dec 28 '17 20:12 kozec

Ok, I have to ask you what gave you idea that anything of this should work and what's expected output of xinput test. It doesn't looks like it can handle any of REL_Z, ABS_Z nor ABS_PRESSURE.

kozec avatar Dec 28 '17 21:12 kozec

Well, it is just a wild idea. The Steam controller is a very versatile input device, I think, so I'm trying to use it on everything. I know little about xinput stuff. :sweat_smile:

Here's a sample output of xinput test from someone who has a digital pen

$ xinput test 21 # (excerpt)
motion a[0]=1130 a[1]=525 a[2]=946 a[3]=0 a[4]=0 a[5]=0 
motion a[6]=0 a[7]=0 a[8]=0 a[9]=0 a[10]=0 a[11]=0 
motion a[12]=0 
button press   1 
motion a[0]=1130 a[1]=525 a[2]=1002 a[3]=92 a[4]=0 a[5]=0 
motion a[6]=0 a[7]=0 a[8]=0 a[9]=0 a[10]=0 a[11]=0 
motion a[12]=0 
motion a[0]=1130 a[1]=525 a[2]=1012 a[3]=92 a[4]=0 a[5]=0 
motion a[6]=0 a[7]=0 a[8]=0 a[9]=0 a[10]=0 a[11]=0 
motion a[12]=0 

That digital pen is able to do about 13 axes of motion input. While SC Controller seems to only do a[0] up to a[3].

Kalabasa avatar Dec 29 '17 06:12 Kalabasa

Just as sad status report, I was not able to get this to work. There is no problem with enabling any kind of mouse axes here, but no combination seems to work with GIMP. Some combinations may cause xinput to stop recognizing SCController Mouse as mouse, but nothing registers as pen.

I'll leave issue open just in case someone knows more, but right now, I just don't know what to emulate :(

kozec avatar Jan 04 '18 20:01 kozec

Any update on this? Particularly for not just pen pressure, but also pen tilt and rotation. I'm interested in using the SC alongside other devices (be it a mouse or drawing tablet/monitor) as in the other device is used for positioning still (and pressure from a pen OR from SC triggers*). The SC would be in your other hand and could also be used for application-specific shortcuts (which obviously is already possible), the really interesting part would be mapping gyro to brush tilt (and trackpad to rotation) which would allow for brush dynamics a user otherwise wouldn't have access to.


A trick I've found is using a mouse as an assist** for my drawing monitor, but in a recent version of Krita the canvas seems bugged (ignores mouse buttons) when doing so (and this might be an issue for input mixing if it did work with the SC controller). However it oddly works fine in the brush scratchpad, if you click outside of the canvas, or just if pen input is lost for a few seconds.

*=triggers offering no need of screen contact (no nib wear, particularly for high-pressure) and potentially better control+sensitivity

**=full-pressure from mouseclick and position from pen without needing screen contact, middle-mouse to pan, GUI control without moving drawing hand, right-click menu etc