Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrong DS4 buttons values #35

Open
ozzyyzzo4096 opened this issue Jun 5, 2021 · 3 comments
Open

wrong DS4 buttons values #35

ozzyyzzo4096 opened this issue Jun 5, 2021 · 3 comments

Comments

@ozzyyzzo4096
Copy link

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
Copy link
Owner

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

@ozzyyzzo4096
Copy link
Author

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

@JibbSmart
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants