rodrigorc / steamctrl

Utility to setup Valve Steam Controller
GNU General Public License v2.0
15 stars 4 forks source link

DPAD support #2

Closed rym002 closed 4 years ago

rym002 commented 4 years ago

When using the left dpad, the events are fired on touch and not on click like a normal dpad. When using in steam, it can be configured to behave like a dpad and trigger the event on click. Is there a way to achieve the same using hid-steam?

rodrigorc commented 4 years ago

@rym002 : Actually they are different buttons. That is, touching the left-pad is mapped to BTN_THUMB, while pressing it is mapped to BTNDPAD{UP,DOWN,LEFT,RIGHT}. With the right pad it is a bit different: touching it is BTN_THUMB2 while pressing it is BTN_THUMBR.

I know that it may make it a bit difficult to map, in a game menu for example, the BTN_DPAD* buttons, because the BTN_THUMB is always interfering. If you can edit manually the input configuration of your program, then you can fix it manually.

Also, sometimes it helps to enter the configuration menu with the LPAD already touched and never to release it. This way, the BTN_THUMB-down event is never generated in the menu and you can map the DPAD buttons, sliding carefully your finger around the pad. A bit hacky, yes, but it helps.

rym002 commented 4 years ago

When using jstest I only see axis Hat0X and Hat0Y along with ThumbBtn when i touch the pad. I was hoping for some configuration to change the behavior from touchpad to dpad similar to how it works in steam where its configured to be a dpad or other. I will look for tools that can maybe create the js device based on the event device to map to a desired config.

rodrigorc commented 4 years ago

@rym002 Sorry, but the jstest subsystem is just not so configurable. Once, I considered adding a few knobs to the kernel driver, but that was not very well received. Understandably, if every input driver added its own weird configurations, the input subsystem would quickly become an unmanageable mess.

That said, there are a few user programs to do what you want. Personally I use my own [self-sponsor]inputmap tool[/self-sponsor], that can use the Steam controller natively, and thus also use force-feedback and accelerometer.

rym002 commented 4 years ago

Thanks I was looking at that. Other option I used in the past was xboxdrv. End result I would like to emulate something like an xbox 360 controller and use for emulationstation and retroarch. If it can look like an xbox controller and get autoconfigured, even better :). Does your inputmap support creating the js devices?

On Sun, Jan 26, 2020 at 3:27 PM Rodrigo Rivas Costa < notifications@github.com> wrote:

@rym002 https://github.com/rym002 Sorry, but the jstest subsystem is just not so configurable. Once, I considered adding a few knobs to the kernel driver, but that was not very well received. Understandably, if every input driver added its own weird configurations, the input subsystem would quickly become an unmanageable mess.

That said, there are a few user programs to do what you want. Personally I use my own [self-sponsor]inputmap https://github.com/rodrigorc/inputmap tool[/self-sponsor], that can use the Steam controller natively, and thus also use force-feedback and accelerometer.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rodrigorc/steamctrl/issues/2?email_source=notifications&email_token=ABHKXN57RLSJX3KGSQQH4D3Q7XWZNA5CNFSM4KJKRTUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ55BII#issuecomment-578539681, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHKXN4YALVVVFA4WWQCUDLQ7XWZNANCNFSM4KJKRTUA .

rodrigorc commented 4 years ago

@rym002

Does your inputmap support creating the js devices? Sure it does! It uses the /dev/uinput device, so for the rest of the system it behaves just like a standard device. Unless you do something fancy, like mixing relative and absolute axes to the same device.

If it can look like an xbox controller and get autoconfigured...

I've just committed a couple of configuration examples that emulate an X-box controller. The exact details vary with the software used, I'm not totally sure why (and I don't have a real X-box controller to compare, if you happen to have one, I'd like to run some experiments :-P). Just run inputmap examples/xbox.ini with the controller connected and see what happens.

rym002 commented 4 years ago

I dont have an xbox controller (well i have some original xbox) but I used xboxdrv in the past an also notice steam can emulate the xbox controller including the axis and name etc so it gets detected. You maybe able to run via steam and compare the events.

I will be happy to test your code/config. I use gentoo, I will create a local build to compile and install. I am not strong in C (more of a java guy) so it will probably take me a little longer than normal, but good learning.

On Sun, Jan 26, 2020 at 4:10 PM Rodrigo Rivas Costa < notifications@github.com> wrote:

@rym002 https://github.com/rym002

Does your inputmap support creating the js devices? Sure it does! It uses the /dev/uinput device, so for the rest of the system it behaves just like a standard device. Unless you do something fancy, like mixing relative and absolute axes to the same device.

If it can look like an xbox controller and get autoconfigured...

I've just committed a couple of configuration examples that emulate an X-box controller. The exact details vary with the software used, I'm not totally sure why (and I don't have a real X-box controller to compare, if you happen to have one, I'd like to run some experiments :-P). Just run inputmap examples/xbox.ini with the controller connected and see what happens.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/rodrigorc/steamctrl/issues/2?email_source=notifications&email_token=ABHKXNZG6SGBHUM3DTFVP7LQ7X33PA5CNFSM4KJKRTUKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEJ5562I#issuecomment-578543465, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABHKXN27DN6DUBAY56RC4CDQ7X33PANCNFSM4KJKRTUA .

rodrigorc commented 4 years ago

@rym002: Please do test it. Any issue or suggestion you may have, do not hesitate and open an issue there.

See you soon!