godotengine / godot-docs

Godot Engine official documentation
https://docs.godotengine.org
Other
3.91k stars 3.2k forks source link

Add example for device that supports InputEventJoypadButton's pressure property #8549

Closed stephanbogner closed 8 months ago

stephanbogner commented 10 months ago

Your Godot version:

Not relevant

Context

In my game I want to support as many controllers as possible so I want to know what I have to look out for / test with.

Issue description:

The docs for InputEventJoypadButton > pressure states Represents the pressure the user puts on the button with their finger, if the controller supports it. I have never heard of a button that also detects pressure (which is not a trigger). A note on which device / types of devices this exists would be helpful.

Maybe this is supported by less-common devices like fancy midi-keyboards / drawing tablets? 🤔

PR

I am happy to phrase the sentence and open a PR once I know what devices/buttons this refers to.

URL to the documentation page (if already existing):

https://docs.godotengine.org/en/stable/classes/class_inputeventjoypadbutton.html#class-inputeventjoypadbutton-property-pressure

Mickeon commented 9 months ago

I have never heard of a button that also detects pressure (which is not a trigger). A note on which device / types of devices this exists would be helpful.

It's not novel. Most of the buttons on the Playstation 2 & 3's controller are pressure-sensitive, but it was relegated back to only the back triggers because the feature was fairly underutilised. Unfortunately, I do not have those controllers to test them, but this is is what they are referring to.

stephanbogner commented 9 months ago

@Mickeon Oh wow! I even had a ps3 and can't remember any game utilizing it.

I still have it at my parent's place. If it still works I am gonna try it out and make a PR (so even younger generations know what this refers to 😅).

Thanks for giving an example.

stephanbogner commented 8 months ago

This was much harder to check then I expected.

On Mac:

On Windows:

  1. I could get the PS3 controller (Sony Dualshock 3) to work through DsHidMini x64 (driver chart which shows support for pressure sensitive buttons)
  2. I then used the HID device mode SXS which supports pressure sensitive buttons
  3. I installed the Playstation 3 emulator RPCS3 and used the "GamePad Test homebrew" to verify that pressure sensitive buttons are working properly
  4. Unfortunately Godot still shows pressure=0.00 😔 ... so I am not if it's a Godot bug or some driver issue

PS: I found an interesting video about "The Short History of Pressure Sensitive Buttons" with a great example about Metal Gear Solid utilizing it.

stephanbogner commented 8 months ago

Even if I couldn't get it to work, we could still update the docs with something like:

Ranges from 0.0 to 1.0. Represents the pressure the user puts on the button with their finger (if the controller supports it). Nowadays not a common feature but present on gamepads such as the Sony Dualshock 2 & 3 or original Xbox controller.

Mickeon commented 8 months ago

I asked on RocketChat about this and it's pretty amusing to me.

In a nutshell, this property has existed ever since Godot became open source. But as it turns out, it was never implemented at all, at least on Windows. Joypad drivers do not use it. It should not exist at all. It probably went completely unnoticed for how obscure this feature is. Requesting this feature nowadays would probably be a good proposal. But the description absolutely needs to change now.

stephanbogner commented 8 months ago

@Mickeon Haha, that is funny indeed.

It was an interesting rabbit hole though. Now I am actually kinda sad, that that feature is gone from the gaming world basically forever (not because of Godot but because of controllers not having it anymore).

Thanks for asking around ❤️