Commit Graph

30 Commits

Author SHA1 Message Date
Jonathan Li 354b11c619 onepad|spu2-x: Avoid -Wmissing-braces on clang 2018-08-07 00:15:10 +01:00
Gregory Hainaut 0939424574 onepad: be sure m_unique_id is set even in case of early return
not important as the object will be deleted but please coverity
2017-05-11 21:47:39 +02:00
Gregory Hainaut a71a549fa3 onepad: create a LUT for the pad key => SDL key mapping
Initial plan was to allow to remap the logical (SDL) key.
Unfortunately I feel some issues with the current enum.
* button/axis overlap
* trigger/axis must be handled differently

Nevertheless, code is easier this way
2017-05-03 12:33:42 +02:00
Gregory Hainaut 7597b31215 onepad: replace conf pointer by g_conf object 2017-05-03 12:03:56 +02:00
Gregory Hainaut 36528bb723 onepad: allow to save/reload SDL2 mapping from OnePAD2.ini file
SDL_GAMECONTROLLERCONFIG is nice but limited to a single entry. (Note it can still be used)

Option name is SDL2. Here an example

SDL2 = 03000000a306000020f6000011010000,PS2700 Rumble Pad,a:b1,b:b2,back:b8,dpdown:h0.4,dpleft:h0.8,dpright:h0.2,dpup:h0.1,guide:b12,leftshoulder:b4,leftstick:b10,lefttrigger:b6,leftx:a0,lefty:a1,rightshoulder:b5,rightstick:b11,righttrigger:b7,rightx:a2,righty:a4,start:b9,x:b0,y:b3,platform:Linux,
2017-05-03 12:03:56 +02:00
Gregory Hainaut 2159245224 onepad: add DUALSHOCK4 USB Wireless Adapator mapping
Close #1924
2017-05-02 10:07:17 +02:00
Gregory Hainaut 3cff588eff onepad: add an unique identifier 2017-04-28 11:27:19 +02:00
Gregory Hainaut c183de5662 onepad: add hot-plugging support
Note: pad to player mapping is done later

v2: remove the useless print
2017-04-28 11:27:19 +02:00
Gregory Hainaut 1b369520ed onepad: drop the pad if an error was detected
v2:
init m_no_error in gamepad constructor
2017-04-28 11:27:19 +02:00
Gregory Hainaut 2e09c7faf3 onepad: Move init/destroy code to constructor/destructor
* prefix remaining member with m_
* Use array for m_effect_id
* Properly Destroy/Close Haptic/Joystick/Game Controller
 (except on older SDL versions which are buggy)
2017-04-28 11:27:19 +02:00
Gregory Hainaut 4b24cfa5ea onepad: use external resource to support more joysticks 2017-04-28 11:27:19 +02:00
Gregory Hainaut 9da843c994 onepad: plug SDL2 API game controller 2017-04-28 11:27:19 +02:00
Gregory Hainaut 94e19ac903 onepad: remove SDL1 manual detection code path 2017-04-28 11:27:19 +02:00
Gregory Hainaut 61182249f0 onepad: drop hacks/options for DualShock3
SDL2 will take care of correct detection
2017-04-28 11:27:19 +02:00
Gregory Hainaut 5c537fdbe3 onepad: properly indent comments
Clang-format doesn't like the double *
2017-04-28 11:27:19 +02:00
Gregory Hainaut 9c7e9cc6f2 onepad: use range loop and vector of unique_ptr to manage the joystick 2017-04-28 11:27:19 +02:00
Gregory Hainaut ef3435441f onepad: create a legacy version for SDL1
The legacy version is the version 1.3

The new version is the version 2.0. It would be based on SDL2 only

Distribution information.
If you link wxWidget with SDL, you will need to be sure it is SDL2 or upgrade.

You can build wxWidget with SDL2 with the following trick

export SDL_CONFIG=/usr/bin/sdl2-config
./configure --with-sdl .....
2017-04-19 19:02:36 +02:00
Jonathan Li 0708d7c539 onepad: Fix variable type
Fixes a type limits warning on a 64-bit build.
2016-12-18 14:32:13 +00:00
Clang Format 604d3bac3c clang format: set SpacesBeforeTrailingComments to 1 2016-10-16 21:42:31 +02:00
Gregory Hainaut 4796803c33 pcsx2: Remove == true/false for boolean logic (#1556)
As discussed in #1553

Clang Tidy reports goes from 156 to 9.

Remain some macro in spu2x + a deadcode line
2016-09-10 20:08:14 +02:00
Clang Format f06f44c30a reformat onepad 2016-09-08 21:52:49 +02:00
Gregory Hainaut 2d8a0dc59c onepad: fix a couple of ccpcheck warning
Yes I know formating suck
2016-08-12 22:36:17 +02:00
kust2708 823a37aed7 OnePad : New GUI based on gwWidget
Buttons done, configuration initialization done.
Still need to add Gamepad and Joysticks configuration frames.
Require png file for the moment (the embedded picture will be fixed after).

New Onepad GUI based on wxWidget (Main frame almost finish)
Background picture is now embedded
Button binding works
Loading and saving works
Need to add feedback and gamepad, joysticks configuration frame

Modification of the onepad CMakeList.txt
Automatic generation of images headers using perl script

Modification of the test feedback function
2016-02-14 17:26:31 +01:00
Gregory Hainaut 9f2fa79fe3 forget to remove a debug message 2015-11-21 18:34:59 +01:00
Gregory Hainaut 80bdbb5f24 onepad: add an option to workaround DS3 issue with SDL2
I don't understand the magic but sometimes pad buttons are detected as buttons
sometimes as axis. Create an option so people can test both and hopefully find a working solution

Note: you need to restart the plugin to take the option into account
Note2: fix dual pad init too

Related issue #938 and #414
2015-11-21 18:33:51 +01:00
Gregory Hainaut 6a38e1d06e onepad: init sigaction struct 2015-11-02 07:36:17 +01:00
Gregory Hainaut 96fc260488 linux: restore default INT/TERM signal handler
Allow to use CTRL-C to quit PCSX2 ("regression" of SDL2)
2015-10-29 15:04:55 +01:00
Gregory Hainaut eb387e16f4 onepad: fix compilation on SDL1 2015-10-17 14:38:46 +02:00
3kinox d7155f839f onepad:
+ Implement and activate rumble.
2015-10-16 23:55:18 +02:00
3kinox fb0d7139f2 onepad:
+ Isolate every SDL code paths and replace any call to them by call to a generic class "GamePad" of which JoystickInfo is now a child.
+ Now backends can be added by inheriting GamePad generic class.
+ There is just one function change which is redundant with next commits but otherwise commit will not compile(which is more evil).
2015-10-16 23:53:51 +02:00