mirror of
https://github.com/moonlight-stream/moonlight-embedded.git
synced 2026-04-04 23:16:06 +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:
@@ -104,11 +104,13 @@ public class Gamepad {
|
||||
}
|
||||
|
||||
private void handleComponent(Component comp, float value) {
|
||||
ControllerComponent contComp = config.getControllerComponent(comp);
|
||||
if (contComp.isAnalog()) {
|
||||
handleAnalog(contComp, value);
|
||||
} else {
|
||||
handleButtons(contComp, value);
|
||||
if (config != null) {
|
||||
ControllerComponent contComp = config.getControllerComponent(comp);
|
||||
if (contComp.isAnalog()) {
|
||||
handleAnalog(contComp, value);
|
||||
} else {
|
||||
handleButtons(contComp, value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,14 +149,14 @@ public class Gamepad {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void handleButtons(ControllerComponent contComp, float value) {
|
||||
boolean press = false;
|
||||
|
||||
if (value > 0.5F) {
|
||||
press = true;
|
||||
}
|
||||
|
||||
|
||||
switch (contComp) {
|
||||
case BTN_A:
|
||||
toggle(ControllerPacket.A_FLAG, press);
|
||||
|
||||
Reference in New Issue
Block a user