You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: LICENSE.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
### MIT License
2
2
3
-
Copyright 2018-2019 Julian Smart
3
+
Copyright 2018-2021 Julian Smart
4
4
5
5
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copy file name to clipboardExpand all lines: README.md
+9-8Lines changed: 9 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,7 @@
1
1
# JoyShockLibrary
2
-
The Sony PlayStation DualShock 4, Nintendo Switch JoyCons (used in pairs), and Nintendo Switch Pro Controller have much in common. They have many of the features expected of modern game controllers. They also have an incredibly versatile and underutilised input that their biggest rival (Microsoft's Xbox One controller) doesn't have: the gyro.
2
+
The Sony PlayStation's DualShock 4, DualSense, Nintendo Switch Joy-Cons (used in pairs), and Nintendo Switch Pro Controller have much in common. They have many of the features expected of modern game controllers. They also have an incredibly versatile and underutilised input that their biggest rival (Microsoft's Xbox One controller) doesn't have: the gyro.
3
3
4
-
My goal with JoyShockLibrary is to enable game developers to support DS4, JoyCons, and Pro Controllers natively in PC games. I've compiled the library for Windows, but it uses platform-agnostic tools, and my hope is that other developers would be able to get it working on other platforms (such as Linux or Mac) without too much trouble.
4
+
My goal with JoyShockLibrary is to enable game developers to support DS4, DS, Joy-Cons, and Pro Controllers natively in PC games. I've compiled the library for Windows, but it uses platform-agnostic tools, and my hope is that other developers would be able to get it working on other platforms (such as Linux or Mac) without too much trouble.
5
5
6
6
## Contents
7
7
***[Releases](#releases)**
@@ -21,7 +21,7 @@ The latest version of JoyShockLibrary can always be found [here](https://github.
21
21
*JoyShockLibrary.h* has everything you need to use the library, but here's a breakdown of everything in there.
22
22
23
23
### Structs
24
-
**struct JOY\_SHOCK\_STATE** - This struct contains the state for all the sticks, buttons, and triggers on the controller. If you're just using JoyShockLibrary to be able to use JoyCons, Pro Controllers, and DualShock 4s similarly to how you'd use other devices, this has everything you need to know.
24
+
**struct JOY\_SHOCK\_STATE** - This struct contains the state for all the sticks, buttons, and triggers on the controller. If you're just using JoyShockLibrary to be able to use Joy-Cons, Pro Controllers, DualSenses, and DualShock 4s similarly to how you'd use other devices, this has everything you need to know.
25
25
***int buttons** contains the states of all the controller's buttons with the following masks:
26
26
*```0x00001``` - d-pad ```up```
27
27
*```0x00002``` - d-pad ```down```
@@ -41,8 +41,8 @@ The latest version of JoyShockLibrary can always be found [here](https://github.
41
41
*```0x08000``` - the North face-button: ```X``` on Nintendo devices, ```△``` on DS4
42
42
*```0x10000``` - ```Home``` on Nintendo devices, ```PS``` on DS4
43
43
*```0x20000``` - ```Capture``` on Nintendo devices, ```touchpad click``` on DS4, ```Create``` on DS5
44
-
*```0x40000``` - ```SL``` on Nintendo JoyCons, ```Mic``` on DS5
45
-
*```0x80000``` - ```SR``` on Nintendo JoyCons
44
+
*```0x40000``` - ```SL``` on Nintendo Joy-Cons, ```Mic``` on DS5
45
+
*```0x80000``` - ```SR``` on Nintendo Joy-Cons
46
46
***float lTrigger** - how far has the left trigger been pressed? This will be 1 or 0 on Nintendo devices, which don't have analog triggers
47
47
***float rTrigger** - how far has the right trigger been pressed? This will be 1 or 0 on Nintendo devices, which don't have analog triggers
48
48
***float stickLX, stickLY** - left-stick X axis and Y axis, respectively, from -1 to 1
@@ -114,8 +114,8 @@ All these functions *should* be thread-safe, and none of them should cause any h
114
114
**void JslSetTouchCallback(void(\*callback)(int, TOUCH\_STATE, TOUCH\_STATE, float))** - Set a callback function by which JoyShockLibrary can report the current touchpad state for each device. Only DualShock 4s will use this. This callback will be given the *deviceId* for the reporting device, its current and previous touchpad states, and the amount of time since the last report for this device (in seconds).
115
115
116
116
**int JslGetControllerType(int deviceId)** - What type of controller is this device?
117
-
1. Left JoyCon
118
-
2. Right JoyCon
117
+
1. Left Joy-Con
118
+
2. Right Joy-Con
119
119
3. Switch Pro Controller
120
120
4. DualShock 4
121
121
5. DualSense
@@ -141,7 +141,7 @@ Player 5: ```xxxxx```
141
141
142
142
## Known and Perceived Issues
143
143
### Bluetooth connectivity
144
-
JoyCons and Pro Controllers are normally only be connected by Bluetooth. Some Bluetooth adapters can't keep up with these devices, resulting in laggy input. This is especially common when more than one device is connected (such as when using a pair of JoyCons). There is nothing JoyShockMapper or JoyShockLibrary can do about this.
144
+
Joy-Cons and Pro Controllers are normally only be connected by Bluetooth. Some Bluetooth adapters can't keep up with these devices, resulting in laggy input. This is especially common when more than one device is connected (such as when using a pair of Joy-Cons). There is nothing JoyShockMapper or JoyShockLibrary can do about this.
145
145
146
146
There is experimental support for connecting supported Switch controllers by USB now. Please let me know if you have any issues (or success!) with it.
147
147
@@ -160,6 +160,7 @@ JoyShockLibrary v2 changes the gyro and accelerometer axes from previous version
160
160
I'm Jibb Smart, and I made JoyShockLibrary. JoyShockLibrary has also benefited from the contributions of:
161
161
* Romeo Calota (Linux support + general portability improvements)
162
162
* RollinBarrel (touchpad support)
163
+
* Robin (wireless DS4/5 support)
163
164
164
165
JoyShockLibrary uses substantial portions of mfosse's [JoyCon-Driver](https://github.com/mfosse/JoyCon-Driver), a [vJoy](http://vjoystick.sourceforge.net/site/) feeder for most communication with Nintendo devices, building on it with info from dekuNukem's [Nintendo Switch Reverse Engineering](https://github.com/dekuNukem/Nintendo_Switch_Reverse_Engineering/) page in order to (for example) unpack all gyro and accelerometer samples from each report.
0 commit comments