File tree Expand file tree Collapse file tree 2 files changed +15
-3
lines changed
src/uk/co/electronstudio/sdl2gdx Expand file tree Collapse file tree 2 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 10
10
import com .badlogic .gdx .utils .IntArray ;
11
11
import org .libsdl .*;
12
12
13
- import static uk .co .electronstudio .sdl2gdx .SDL2ControllerManager .InputPreference .XINPUT ;
13
+ import static uk .co .electronstudio .sdl2gdx .SDL2ControllerManager .InputPreference .* ;
14
14
15
15
public class SDL2ControllerManager implements ControllerManager {
16
16
@@ -22,7 +22,18 @@ public class SDL2ControllerManager implements ControllerManager {
22
22
private boolean running = true ;
23
23
24
24
public SDL2ControllerManager () {
25
- this (XINPUT );
25
+ this (getInputPreferenceProperty ());
26
+ }
27
+
28
+ private static InputPreference getInputPreferenceProperty () {
29
+ String ip = System .getProperty ("SDL.input" );
30
+ if (ip ==null ) return XINPUT ;
31
+ switch (ip ){
32
+ case "XINPUT" : return XINPUT ;
33
+ case "RAW_INPUT" : return RAW_INPUT ;
34
+ case "DIRECT_INPUT" : return DIRECT_INPUT ;
35
+ default : return XINPUT ;
36
+ }
26
37
}
27
38
28
39
public enum InputPreference {
Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ public static void main(String[] args) {
40
40
}
41
41
42
42
private static void init () {
43
-
43
+ //System.setProperty("SDL.input","DIRECT_INPUT");
44
+ //controllerManager = new SDL2ControllerManager();
44
45
controllerManager = new SDL2ControllerManager ((SDL2ControllerManager .InputPreference ) inputPref .getSelectedItem ());
45
46
}
46
47
You can’t perform that action at this time.
0 commit comments