berarma / new-lg4ff

Experimental Logitech force feedback module for Linux
GNU General Public License v2.0
298 stars 18 forks source link

Option to generate keyboard events for extra buttons #43

Closed tnijkes closed 3 years ago

tnijkes commented 3 years ago

Background info: F1 2020 on Google Stadia, or perhaps any other game on Google Stadia, does not support more than the standard 17 buttons on a gamepad-like device. The extra buttons do work in the Chromium browser (checked with https://gamepad-tester.com), just not in Stadia. I patched the Chromium browser to recognise the DFGT as a Standard gamepad device, but you could also use a browser extension like ControlStadia.

I have created a new module option in new-lg4ff to have the extra buttons generate regular keyboard events on my Driving Force GT. That way, I can use all buttons on Google Stadia.

Would you consider adopting this option in the mainline?

berarma commented 3 years ago

It's a hardcoded workaround for a Stadia issue aimed at a particular game. I don't think this fits the purpose of a driver module.

For the generic goal of mapping controllers to mouse/keys, I think sc-controller does a good work. I just wish it had better support for wheels but it can be used.

leillo1975 commented 3 years ago

Antimicro make this work perfectly: https://github.com/AntiMicro/antimicro

berarma commented 3 years ago

Antimicro make this work perfectly: https://github.com/AntiMicro/antimicro

Great suggestion but you should use AntiMicroX instead by the Readme information.

tnijkes commented 3 years ago

It's a hardcoded workaround for a Stadia issue aimed at a particular game. I don't think this fits the purpose of a driver module.

For the generic goal of mapping controllers to mouse/keys, I think sc-controller does a good work. I just wish it had better support for wheels but it can be used.

Yes, true, But isn't the kernel full of hardcoded workarounds? ;-) I suggested to use a driver option to actually activate it, to ease the pain.

I have tried and used all other suggested workarounds, but such middleware isn't really an elegant option either. Basically, they all introduce lag. Most importantly, middleware may hide the new force feedback functionality in new-lg4ff from the final application.

Well, I will keep on using my own ugly fork then :-) Thanks.

jotomo commented 3 years ago

I gave AntiMicroX a try to map some of the buttons from my G27 to control system volume, but Dirt Rally 2.0 seems to have exclusive access to the G27. My use-case would be controlling intercom volume by mapping G27 buttons to control system volume since the game doesn't directly support that adjusting volume. @berarma Would a solution be technically feasible and appropriate for a driver that uses a module parameter with a list of buttonId -> keySymbol / keyId mappings that can be specified to cover use-cases for all wheel and games?

berarma commented 3 years ago

I gave AntiMicroX a try to map some of the buttons from my G27 to control system volume, but Dirt Rally 2.0 seems to have exclusive access to the G27.

It would be a very unusual case. Have you tried running Oversteer and using it while the game is running? I guess it will work.

My use-case would be controlling intercom volume by mapping G27 buttons to control system volume since the game doesn't directly support that adjusting volume. @berarma Would a solution be technically feasible and appropriate for a driver that uses a module parameter with a list of buttonId -> keySymbol / keyId mappings that can be specified to cover use-cases for all wheel and games?

I don't think it's a good idea at all. It would make a lot more sense, and I guess it would be more beneficial for all, to figure out why AntiMicroX isn't working and try to fix it. Let's fix the hammer instead of trying to make the screwdriver behave as a hammer.

jotomo commented 3 years ago

I don't think it's a good idea at all

I had a hunch you'd say that ;-) I'll give AntiMicroX another try, I might be thinking of Win7 behavior w.r.t. to exclusive access. If AntiMicroX can handle the use-case I certainly agree it should go there, rather than a driver.