+ boolean anyTextGadgetActiveOrJustFinished = anyTextGadgetActive();
+ static struct SetupKeyboardInfo custom_key;
+ static struct
+ {
+ Key *key_custom;
+ Key key_default;
+ byte action;
+ } key_info[] =
+ {
+ { &custom_key.left, DEFAULT_KEY_LEFT, JOY_LEFT },
+ { &custom_key.right, DEFAULT_KEY_RIGHT, JOY_RIGHT },
+ { &custom_key.up, DEFAULT_KEY_UP, JOY_UP },
+ { &custom_key.down, DEFAULT_KEY_DOWN, JOY_DOWN },
+ { &custom_key.snap, DEFAULT_KEY_SNAP, JOY_BUTTON_1 },
+ { &custom_key.bomb, DEFAULT_KEY_BOMB, JOY_BUTTON_2 }
+ };
+
+ if (game_status == PLAYING)
+ {
+ /* only needed for single-step tape recording mode */
+ static boolean clear_button_2[MAX_PLAYERS] = { FALSE,FALSE,FALSE,FALSE };
+ static boolean bomb_placed[MAX_PLAYERS] = { FALSE,FALSE,FALSE,FALSE };
+ int pnr;
+
+ for (pnr=0; pnr<MAX_PLAYERS; pnr++)
+ {
+ int i;
+ byte key_action = 0;
+
+ if (setup.input[pnr].use_joystick)
+ continue;
+
+ custom_key = setup.input[pnr].key;
+
+ for (i=0; i<6; i++)
+ if (key == *key_info[i].key_custom)
+ key_action |= key_info[i].action;