mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-04 15:06:03 +00:00
Work in progress: fixing gamepad to work on all OSs and be customizable
This commit is contained in:
@@ -19,6 +19,8 @@ public abstract class Gamepad {
|
||||
protected short leftStickX = 0x0000;
|
||||
protected short leftStickY = 0x0000;
|
||||
|
||||
protected GamepadSettings configuration;
|
||||
|
||||
public enum ControllerType { XBOX, PS3 };
|
||||
|
||||
|
||||
@@ -37,12 +39,18 @@ public abstract class Gamepad {
|
||||
this.conn = conn;
|
||||
this.pad = pad;
|
||||
|
||||
configuration = new GamepadSettings();
|
||||
|
||||
for (Component comp : pad.getComponents()) {
|
||||
initValue(comp);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public GamepadSettings getConfiguration() {
|
||||
return configuration;
|
||||
}
|
||||
|
||||
private void initValue(Component comp) {
|
||||
handleComponent(comp, comp.getPollData());
|
||||
}
|
||||
@@ -56,6 +64,10 @@ public abstract class Gamepad {
|
||||
leftStickX, leftStickY, rightStickX, rightStickY);
|
||||
}
|
||||
|
||||
public EventQueue getEvents() {
|
||||
return pad.getEventQueue();
|
||||
}
|
||||
|
||||
public void handleEvents() {
|
||||
EventQueue queue = pad.getEventQueue();
|
||||
Event event = new Event();
|
||||
|
||||
Reference in New Issue
Block a user