mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-05 23:46:17 +00:00
more gamepad stuff
- now have settings files - now read/write gamepad settings to file - now map button/axis for gamepads
This commit is contained in:
@@ -6,6 +6,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.limelight.nvstream.NvConnection;
|
||||
import com.limelight.settings.GamepadSettingsManager;
|
||||
|
||||
import net.java.games.input.Controller;
|
||||
|
||||
@@ -18,9 +19,11 @@ public class GamepadHandler {
|
||||
|
||||
gamepads.clear();
|
||||
|
||||
|
||||
GamepadSettings settings = GamepadSettingsManager.getSettings();
|
||||
for (Controller pad : pads) {
|
||||
|
||||
gamepads.add(new Gamepad(pad, null)); //TODO: need to create/get the settings for this controller
|
||||
gamepads.add(new Gamepad(pad, settings));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +37,7 @@ public class GamepadHandler {
|
||||
|
||||
public static void startUp() {
|
||||
if (handler == null || !handler.isAlive()) {
|
||||
System.out.println("Gamepad Handler thread starting up");
|
||||
handler = new Thread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
@@ -42,6 +46,7 @@ public class GamepadHandler {
|
||||
if (!gamepad.poll()) {
|
||||
break;
|
||||
}
|
||||
|
||||
gamepad.handleEvents(conn);
|
||||
}
|
||||
try {
|
||||
@@ -56,6 +61,7 @@ public class GamepadHandler {
|
||||
|
||||
public static void stopHandler() {
|
||||
if (handler != null && handler.isAlive()) {
|
||||
System.out.println("Stopping Gamepad Handler thread");
|
||||
handler.interrupt();
|
||||
conn = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user