- draw_key_config(opts, opt_cnt, player_idx, sel);\r
- inp = wait_for_input_usbjoy(CONFIGURABLE_KEYS, &joy);\r
- // printf("got %08lX from joy %i\n", inp, joy);\r
- if (joy == 0)\r
- {\r
- if (!(inp & GP2X_SELECT)) {\r
- prev_select = 0;\r
- if(inp & GP2X_UP ) { sel--; if (sel < 0) sel = menu_sel_max; continue; }\r
- if(inp & GP2X_DOWN) { sel++; if (sel > menu_sel_max) sel = 0; continue; }\r
- }\r
- if (sel >= opt_cnt) {\r
- if (inp & (GP2X_B|GP2X_X)) break;\r
- else continue;\r
- }\r
- // if we are here, we want to bind/unbind something\r
- if ((inp & GP2X_SELECT) && !prev_select)\r
- unbind_action(opts[sel].mask, player_idx, -1);\r
- prev_select = inp & GP2X_SELECT;\r
- inp &= CONFIGURABLE_KEYS;\r
- inp &= ~GP2X_SELECT;\r
- for (i = 0; i < 32; i++)\r
- if (inp & (1 << i)) {\r
- if (count_bound_keys(opts[sel].mask, player_idx, 0) >= 2)\r
- currentConfig.KeyBinds[i] &= ~opts[sel].mask; // allow to unbind only\r
- else currentConfig.KeyBinds[i] ^= opts[sel].mask;\r
- if (player_idx >= 0 && (currentConfig.KeyBinds[i] & opts[sel].mask)) {\r
- currentConfig.KeyBinds[i] &= ~(3 << 16);\r
- currentConfig.KeyBinds[i] |= player_idx << 16;\r
- }\r
- }\r
+ draw_key_config(opts, opt_cnt, player_idx, sel, 0);\r
+ mkey = wait_for_input(PBTN_UP|PBTN_DOWN|PBTN_SOUTH|PBTN_EAST);\r
+ switch (mkey) {\r
+ case PBTN_UP: sel--; if (sel < 0) sel = menu_sel_max; continue;\r
+ case PBTN_DOWN: sel++; if (sel > menu_sel_max) sel = 0; continue;\r
+ case PBTN_SOUTH:\r
+ if (sel >= opt_cnt)\r
+ return;\r
+ continue;\r
+ case PBTN_EAST:\r
+ if (sel >= opt_cnt)\r
+ return;\r
+ break;\r
+ default:continue;\r