JibbSmart / JoyShockLibrary

Read DualSense, DualShock 4, JoyCon, and Pro Controller input on PC -- compiled for Windows, but code should work on other platforms.
Other
226 stars 42 forks source link

wrong DS4 buttons values #35

Open ozzyyzzo4096 opened 3 years ago

ozzyyzzo4096 commented 3 years ago

For some reasons my DS4 device is returning others button values than expected (using both JslGetSimpleState(...) or JslGetButtons(...) )

your definitions ->

define JOYSHOCK_JOY_RIGHT 0

define JOYSHOCK_JOY_LEFT 1

define JOYSHOCK_JOY_UP 2

define JOYSHOCK_JOY_DOWN 3

define JOYSHOCK_JOY_NEAR 4

define JOYSHOCK_JOY_FAR 5

define JOYSHOCK_DPAD_UP_BUTTON 6

define JOYSHOCK_DPAD_DOWN_BUTTON 7

define JOYSHOCK_DPAD_LEFT_BUTTON 8

define JOYSHOCK_DPAD_RIGHT_BUTTON 9

//DS4

define JOYSHOCK_OPTIONS_BUTTON 10

define JOYSHOCK_SHARE_BUTTON 11

define JOYSHOCK_L3_BUTTON 12

define JOYSHOCK_R3_BUTTON 13

define JOYSHOCK_L1_BUTTON 14

define JOYSHOCK_R1_BUTTON 15

define JOYSHOCK_L2_BUTTON 16

define JOYSHOCK_R2_BUTTON 17

define JOYSHOCK_CROSS_BUTTON 18

define JOYSHOCK_CIRCLE_BUTTON 19

define JOYSHOCK_SQUARE_BUTTON 20

define JOYSHOCK_TRIANGLE_BUTTON 21

define JOYSHOCK_PS_BUTTON 22

define JOYSHOCK_TOUCHPAD_BUTTON 23

my actual values (mask then index)

//1 up - 0 //2 down - 1 //4 left - 2 //8 right - 3 //0x10 OPTIONS top right 4 //0x20 SCREENSHOT top left 5 //0x40 CursorLeftButton 6 //0x80 CursorRightButton 7 //0x100 L1 8 //0x200 R1 9 //0x400 L2 0xa //0x800 R2 0xb //0x1000 A 0xc //0x2000 B 0xd //0x4000 C 0xe //0x8000 D 0xf //0x10000 HOME/START 0x10 //0x20000 TOUCHPAD 0x11

JibbSmart commented 3 years ago

Hi Ozzy! Could this be related to your gamepad not being a PlayStation DualShock 4?

ozzyyzzo4096 commented 3 years ago

Hey :) It's a DS4 compatible gamepad so not genuine.

JibbSmart commented 3 years ago

That'd be why it's structuring its inputs differently. I mean, the developer of that controller didn't have to, but they chose to, and so it's incompatible with JoyShockLibrary without specifically catering to it.