Fix weird axis mapping issue on Ouya

This commit is contained in:
Henrik Rydgård 2013-10-31 11:06:54 +01:00
parent cdee118c60
commit 43240515de
3 changed files with 11 additions and 3 deletions

View file

@ -854,7 +854,7 @@ bool IsNvidiaShield(const std::string &name) {
}
bool IsXperiaPlay(const std::string &name) {
return name == "Sony Ericsson:R800a" || name == "Sony Ericsson:R800i" || name == "Sony Ericsson:R800x" || name == "Sony Ericsson:R800at" || name == "Sony Ericsson:SO-01D" || name == "Sony Ericsson:zeus";
return name == "Sony Ericsson:R800a" || name == "Sony Ericsson:R800i" || name == "Sony Ericsson:R800x" || name == "Sony Ericsson:R800at" || name == "Sony Ericsson:SO-01D" || name == "Sony Ericsson:zeus";
}
bool IsBlackberryQWERTY(const std::string &name) {

View file

@ -97,7 +97,7 @@ bool isJailed;
// Really need to clean this mess of globals up... but instead I add more :P
bool g_TakeScreenshot;
static bool isOuya;
recursive_mutex pendingMutex;
static bool isMessagePending;
static std::string pendingMessage;
@ -420,6 +420,9 @@ void NativeInit(int argc, const char *argv[],
} else {
screenManager->switchScreen(new LogoScreen(boot_filename));
}
std::string sysName = System_GetProperty(SYSPROP_NAME);
isOuya = KeyMap::IsOuya(sysName);
}
void NativeInitGraphics() {
@ -631,16 +634,21 @@ void NativeTouch(const TouchInput &touch) {
}
void NativeKey(const KeyInput &key) {
// ILOG("Key code: %i flags: %i", key.keyCode, key.flags);
g_buttonTracker.Process(key);
if (screenManager)
screenManager->key(key);
}
void NativeAxis(const AxisInput &key) {
// ILOG("Axis id: %i value: %f", (int)key.axisId, key.value);
if (key.axisId >= JOYSTICK_AXIS_ACCELEROMETER_X && key.axisId <= JOYSTICK_AXIS_ACCELEROMETER_Z) {
// Disable accelerometer as an axis for now.
return;
}
if (isOuya && key.axisId >= JOYSTICK_AXIS_OUYA_UNKNOWN1 && key.axisId <= JOYSTICK_AXIS_OUYA_UNKNOWN4) {
return;
}
if (screenManager)
screenManager->axis(key);
}

2
native

@ -1 +1 @@
Subproject commit c3247cfdc7241a473dbfa6f015a045456070acb9
Subproject commit cff2711a7c087edea398ae98dd245ae094bc17c6