mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Merge pull request #14751 from hrydgard/more-input-fixes
More input fixes
This commit is contained in:
commit
08561a2391
3 changed files with 16 additions and 35 deletions
|
@ -579,15 +579,17 @@ void AnalogSetupScreen::update() {
|
|||
}
|
||||
|
||||
bool AnalogSetupScreen::key(const KeyInput &key) {
|
||||
// Allow testing auto-rotation
|
||||
bool retval = UIScreen::key(key);
|
||||
|
||||
// Allow testing auto-rotation. If it collides with UI keys, too bad.
|
||||
bool pauseTrigger = false;
|
||||
mapper_.Key(key, &pauseTrigger);
|
||||
|
||||
if (UI::IsEscapeKey(key)) {
|
||||
TriggerFinish(DR_BACK);
|
||||
return true;
|
||||
return retval;
|
||||
}
|
||||
return true;
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool AnalogSetupScreen::axis(const AxisInput &axis) {
|
||||
|
|
|
@ -44,7 +44,6 @@ private:
|
|||
UI::EventReturn OnDefaultMapping(UI::EventParams ¶ms);
|
||||
UI::EventReturn OnClearMapping(UI::EventParams ¶ms);
|
||||
UI::EventReturn OnAutoConfigure(UI::EventParams ¶ms);
|
||||
UI::EventReturn OnTestAnalogs(UI::EventParams ¶ms);
|
||||
|
||||
virtual void dialogFinished(const Screen *dialog, DialogResult result) override;
|
||||
|
||||
|
|
|
@ -108,10 +108,7 @@ public abstract class NativeActivity extends Activity {
|
|||
|
||||
// Allow for multiple connected gamepads but just consider them the same for now.
|
||||
// Actually this is not entirely true, see the code.
|
||||
private InputDeviceState inputPlayerA;
|
||||
private InputDeviceState inputPlayerB;
|
||||
private InputDeviceState inputPlayerC;
|
||||
private String inputPlayerADesc;
|
||||
private ArrayList<InputDeviceState> inputPlayers = new ArrayList<InputDeviceState>();
|
||||
|
||||
private PowerSaveModeReceiver mPowerSaveModeReceiver = null;
|
||||
private SizeManager sizeManager = null;
|
||||
|
@ -918,35 +915,18 @@ public abstract class NativeActivity extends Activity {
|
|||
if (device == null) {
|
||||
return null;
|
||||
}
|
||||
if (inputPlayerA == null) {
|
||||
inputPlayerADesc = getInputDesc(device);
|
||||
Log.i(TAG, "Input player A registered: desc = " + inputPlayerADesc);
|
||||
inputPlayerA = new InputDeviceState(device);
|
||||
|
||||
for (InputDeviceState input : inputPlayers) {
|
||||
if (input.getDevice() == device) {
|
||||
return input;
|
||||
}
|
||||
}
|
||||
|
||||
if (inputPlayerA.getDevice() == device) {
|
||||
return inputPlayerA;
|
||||
}
|
||||
|
||||
if (inputPlayerB == null) {
|
||||
Log.i(TAG, "Input player B registered: desc = " + getInputDesc(device));
|
||||
inputPlayerB = new InputDeviceState(device);
|
||||
}
|
||||
|
||||
if (inputPlayerB.getDevice() == device) {
|
||||
return inputPlayerB;
|
||||
}
|
||||
|
||||
if (inputPlayerC == null) {
|
||||
Log.i(TAG, "Input player C registered");
|
||||
inputPlayerC = new InputDeviceState(device);
|
||||
}
|
||||
|
||||
if (inputPlayerC.getDevice() == device) {
|
||||
return inputPlayerC;
|
||||
}
|
||||
|
||||
return inputPlayerA;
|
||||
// None was found, just add and return it.
|
||||
InputDeviceState state = new InputDeviceState(device);
|
||||
inputPlayers.add(state);
|
||||
Log.i(TAG, "Input player registered: desc = " + getInputDesc(device));
|
||||
return state;
|
||||
}
|
||||
|
||||
public boolean IsXperiaPlay() {
|
||||
|
|
Loading…
Add table
Reference in a new issue