input-overlay icon indicating copy to clipboard operation
input-overlay copied to clipboard

DPad key codes are different between the OBS plugin and io-cct

Open Dagnus opened this issue 3 years ago • 7 comments

Describe the bug D-Pad buttons created as gamepad buttons are created and work correctly in the confines of the web tool (tested on both Edge and Chrome), but once loaded through the OBS plugin, will no longer be recognized.

The inputs are correctly recognized if using the gamepad preset file set inside OBS

Looking at both json files, the DPad key codes captured by the webtool do not match the ones from the preset file:

  • DPad Up: Preset = 60429, Webtool = 60435
  • DPad Down: Preset = 60430, Webtool = 60436
  • DPad Left: Preset = 60427, Webtool = 60433
  • DPad Right: Preset = 60428, Webtool = 60434

Replacing the webtool generated IDs by the ones from the preset in the JSON will work around the issue in OBS. Loading the gamepad preset in the webtool will not recognized dpad inputs correctly.

Using the arcade-stick preset works correctly both in io-cct and in OBS.

To Reproduce OS: Windows 10 Pro 20H2 19042.985 Gamepad: Microsoft Xbox Series X Controller or Hitbox Cross|Up

Creating a gamepad button for any of the dpad direction.

Expected behavior Key codes should work both inside the webtool and the OBS plugin.

Screenshots! Buttons recognized in Edge but not in OBS

Additional information:

  • input-overlay.v5.0.0rc1-8d04a98
  • OBS Studio: 27.0.0-rc6

Additional context I am trying to create an arcade stick layout for the Hitbox Cross|Up which has both a lever (standing in as a left analog stick) and separate buttons for the d-pad (see Cross|Up Image, they are the white buttons ). I have also tried this with an Xbox Controller and I am seeing the same behavior.

Dagnus avatar May 25 '21 22:05 Dagnus

Tried this with a PS4 controller (with DirectInput) with similar issues as well. FaithG_ has also mentioned having issues getting the DS4 inputs that were registered by io-cct to be recognised by OBS.

Will there be a similar utility to the previous demo_hook, but for XInput and DirectInput keycodes and such?

JustAKat avatar Aug 30 '21 07:08 JustAKat

There's the some test tools here, but the binding dialog in obs studio should be all you need.

univrsal avatar Aug 30 '21 15:08 univrsal

There's the some test tools here, but the binding dialog in obs studio should be all you need.

I did try the binding dialog in OBS Studio, but it seems to be haphazardly picking up some rather random inputs that don't seem to correspond to the pressed buttons. Cheers for the tools!

We have just about figured out which keycodes corresponds to which PS4 buttons prior to this, with just the right analog stick, L2 and R2 (and L3 and R3) still needing to be figured out. However, hopefully with the tools, the DirectInput PS4 preset JSON should be able to be properly finished by faithG_.

JustAKat avatar Aug 30 '21 20:08 JustAKat

I did try the binding dialog in OBS Studio, but it seems to be haphazardly picking up some rather random inputs

Do you have multiple gamepads connected? It might also be your analog sticks sending some ghost inputs, but other than that it should only be looking for the last button pressed or axis moved

univrsal avatar Aug 31 '21 10:08 univrsal

I did try the binding dialog in OBS Studio, but it seems to be haphazardly picking up some rather random inputs

Do you have multiple gamepads connected? It might also be your analog sticks sending some ghost inputs, but other than that it should only be looking for the last button pressed or axis moved

Nope, just one (via usb), and yea, I'm pretty sure my analog sticks are doing that. Doesn't seem to be any workaround to temporarily get it to ignore the jitter, though.

JustAKat avatar Aug 31 '21 13:08 JustAKat

I did try the binding dialog in OBS Studio, but it seems to be haphazardly picking up some rather random inputs

Do you have multiple gamepads connected? It might also be your analog sticks sending some ghost inputs, but other than that it should only be looking for the last button pressed or axis moved

Nope, just one (via usb), and yea, I'm pretty sure my analog sticks are doing that. Doesn't seem to be any workaround to temporarily get it to ignore the jitter, though.

I could add a deadzone which would help

univrsal avatar Aug 31 '21 18:08 univrsal

I did try the binding dialog in OBS Studio, but it seems to be haphazardly picking up some rather random inputs

Do you have multiple gamepads connected? It might also be your analog sticks sending some ghost inputs, but other than that it should only be looking for the last button pressed or axis moved

Nope, just one (via usb), and yea, I'm pretty sure my analog sticks are doing that. Doesn't seem to be any workaround to temporarily get it to ignore the jitter, though.

I could add a deadzone which would help

That might, yes

But to properly add on to OP's, it has been noted that the following are the keycodes that corresponds to the PS4 controller using DirectInput:

Cross ("a" is "60417" Circle ("b") is "60418" Triangle ("y") is "60419" Square ("x") is "60416"

Options ("start") is "60426" Share ("select") is "60425"

However, with the default gamepad preset, with those codes swapped in, those buttons will be detected as intended, but when loaded into and tested on the site, some of them are detected as multiple buttons instead.

Said modified JSON file is as below (zipped as Github does not support JSON) ds4-pad.zip

JustAKat avatar Sep 01 '21 01:09 JustAKat

See https://github.com/univrsal/input-overlay/issues/297 for further tracking

univrsal avatar Dec 05 '22 23:12 univrsal