Ticket #13909: gamepad.patch

File gamepad.patch, 1.7 KB (added by rudism, 18 months ago)
  • backends/platform/android/events.cpp

    diff --git a/backends/platform/android/events.cpp b/backends/platform/android/events.cpp
    index 8f228e51846..80d0f7bcd28 100644
    a b void OSystem_Android::pushEvent(int type, int arg1, int arg2, int arg3,  
    11361136
    11371137                        break;
    11381138
    1139                 case AKEYCODE_BUTTON_X:
     1139                case AKEYCODE_BUTTON_SELECT:
    11401140                        e.kbd.keycode = Common::KEYCODE_ESCAPE;
    11411141                        e.kbd.ascii = Common::ASCII_ESCAPE;
    11421142                        break;
    11431143
    1144                 case AKEYCODE_BUTTON_Y:
     1144                case AKEYCODE_BUTTON_START:
    11451145                        e.type = Common::EVENT_MAINMENU;
    11461146                        break;
    11471147
     1148                case AKEYCODE_BUTTON_MODE:
     1149                        e.kbd.keycode = Common::KEYCODE_TAB;
     1150                        e.kbd.ascii = Common::ASCII_TAB;
     1151                        break;
     1152
     1153                case AKEYCODE_BUTTON_X:
     1154                        e.kbd.keycode = Common::KEYCODE_F1;
     1155                        e.kbd.ascii = Common::ASCII_F1;
     1156                        break;
     1157
     1158                case AKEYCODE_BUTTON_Y:
     1159                        e.kbd.keycode = Common::KEYCODE_F2;
     1160                        e.kbd.ascii = Common::ASCII_F2;
     1161                        break;
     1162
     1163                case AKEYCODE_BUTTON_L1:
     1164                        e.kbd.keycode = Common::KEYCODE_F3;
     1165                        e.kbd.ascii = Common::ASCII_F3;
     1166                        break;
     1167
     1168                case AKEYCODE_BUTTON_R1:
     1169                        e.kbd.keycode = Common::KEYCODE_F4;
     1170                        e.kbd.ascii = Common::ASCII_F4;
     1171                        break;
     1172
     1173                case AKEYCODE_BUTTON_L2:
     1174                        e.kbd.keycode = Common::KEYCODE_F5;
     1175                        e.kbd.ascii = Common::ASCII_F5;
     1176                        break;
     1177
     1178                case AKEYCODE_BUTTON_R2:
     1179                        e.kbd.keycode = Common::KEYCODE_F6;
     1180                        e.kbd.ascii = Common::ASCII_F6;
     1181                        break;
     1182
     1183                case AKEYCODE_BUTTON_THUMBL:
     1184                        e.kbd.keycode = Common::KEYCODE_F7;
     1185                        e.kbd.ascii = Common::ASCII_F7;
     1186                        break;
     1187
     1188                case AKEYCODE_BUTTON_THUMBR:
     1189                        e.kbd.keycode = Common::KEYCODE_F8;
     1190                        e.kbd.ascii = Common::ASCII_F8;
     1191                        break;
     1192
    11481193                default:
    11491194                        LOGW("unmapped gamepad key: %d", arg2);
    11501195                        return;