File tree Expand file tree Collapse file tree 1 file changed +2
-37
lines changed
jme3-core/src/main/java/com/jme3/input Expand file tree Collapse file tree 1 file changed +2
-37
lines changed Original file line number Diff line number Diff line change 66 */
77public enum JoystickState {
88
9- // a list of connected/disconnected codes from various contexts.
10-
11- // using the JoystickState.fromCode(int) method, if the code matches
12- // it will return the enum value.
13-
14- CONNECTED (new int [] {
15- 0x40001 // GLFW.GLFW_CONNECTED / LWJGL3
16- }),
17-
18- DISCONNECTED (new int [] {
19- 0x40002 // GLFW.GLFW_DISCONNECTED / LWJGL3
20- }),
21-
22- UNKNOWN (new int [0 ]);
23-
24- private int [] codes ;
25-
26- JoystickState (int [] codes ) {
27- this .codes = codes ;
28- }
29-
30- private int [] getCodes () {
31- return codes ;
32- }
33-
34- public static JoystickState fromCode (int value ) {
35-
36- for (JoystickState state : values ()) {
37- for (int code : state .getCodes ()) {
38- if (value == code ) {
39- return state ;
40- }
41- }
42- }
43-
44- return UNKNOWN ;
45- }
9+ Connected ,
10+ Disconnected ,
4611
4712}
You can’t perform that action at this time.
0 commit comments