diff --git a/src/od-pandora/config.h b/src/od-pandora/config.h index 8ef9cd80..38d4d070 100644 --- a/src/od-pandora/config.h +++ b/src/od-pandora/config.h @@ -1,17 +1,17 @@ -/* - * UAE - The Un*x Amiga Emulator - * - * User configuration options - * - * Copyright 1995 - 1998 Bernd Schmidt - */ + /* + * UAE - The Un*x Amiga Emulator + * + * User configuration options + * + * Copyright 1995 - 1998 Bernd Schmidt + */ /* * Please note: Many things are configurable with command line parameters, - * and you can put anything you can pass on the command line into a + * and you can put anything you can pass on the command line into a * configuration file ~/.uaerc. Please read the documentation for more * information. - * + * * NOTE NOTE NOTE * Whenever you change something in this file, you have to "make clean" * afterwards. @@ -28,10 +28,10 @@ * well for hardware bangers like games and demos, in fact it will be much * slower. It can also be slower for some applications and/or benchmarks. * It needs a lot of tuning. Please let me know your results with this. - * The second define, RELY_ON_LOADSEG_DETECTION, decides how the compiler + * The second define, RELY_ON_LOADSEG_DETECTION, decides how the compiler * tries to detect self-modifying code. If it is not set, the first bytes * of every compiled routine are used as checksum before executing the - * routine. If it is set, the UAE filesystem will perform some checks to + * routine. If it is set, the UAE filesystem will perform some checks to * detect whether an executable is being loaded. This is less reliable * (it won't work if you don't use the harddisk emulation, so don't try to * use floppies or even the RAM disk), but much faster. @@ -49,3 +49,75 @@ * machine, but may not give optimal performance everywhere. * (These don't do very much yet, except HAVE_RDTSC */ + +/* + * [pismy] defines virtual keys + * Still hard-coded but can be easily changed by recompiling the project... + * See codes here: https://www.libsdl.org/release/SDL-1.2.15/include/SDL_keysym.h + */ + +/* + * Virtual Key for (A) button + * default: HOME (278) + */ +#define VK_A SDLK_HOME + +/* + * Virtual Key for (B) button + * default: END (279) + */ +#define VK_B SDLK_END + +/* + * Virtual Key for (X) button + * default: PAGEDOWN (281) + */ +#define VK_X SDLK_PAGEDOWN + +/* + * Virtual Key for (Y) button + * default: PAGEUP (280) + */ +#define VK_Y SDLK_PAGEUP + +/* + * Virtual Key for (Left shoulder) button + * default: RSHIFT (303) + */ +#define VK_L SDLK_RSHIFT + +/* + * Virtual Key for (Right shoulder) button + * default: RCTRL (305) + */ +#define VK_R SDLK_RCTRL + +/* + * Virtual Key for (up) button + * default: UP (273) + */ +#define VK_UP SDLK_UP + +/* + * Virtual Key for (down) button + * default: DOWN (274) + */ +#define VK_DOWN SDLK_DOWN + +/* + * Virtual Key for (right) button + * default: RIGHT (275) + */ +#define VK_RIGHT SDLK_RIGHT + +/* + * Virtual Key for (left) button + * default: LEFT (276) + */ +#define VK_LEFT SDLK_LEFT + +/* + * Virtual Key for (ESC) button + * default: ESC (27) + */ +#define VK_ESCAPE SDLK_ESCAPE diff --git a/src/od-pandora/gui/CreateFilesysHardfile.cpp b/src/od-pandora/gui/CreateFilesysHardfile.cpp index d73a80fe..bb1def56 100644 --- a/src/od-pandora/gui/CreateFilesysHardfile.cpp +++ b/src/od-pandora/gui/CreateFilesysHardfile.cpp @@ -204,32 +204,32 @@ static void CreateFilesysHardfileLoop(void) { switch(event.key.keysym.sym) { - case SDLK_ESCAPE: + case VK_ESCAPE: dialogFinished = true; break; - case SDLK_UP: + case VK_UP: if(HandleNavigation(DIRECTION_UP)) continue; // Don't change value when enter ComboBox -> don't send event to control break; - case SDLK_DOWN: + case VK_DOWN: if(HandleNavigation(DIRECTION_DOWN)) continue; // Don't change value when enter ComboBox -> don't send event to control break; - case SDLK_LEFT: + case VK_LEFT: if(HandleNavigation(DIRECTION_LEFT)) continue; // Don't change value when enter Slider -> don't send event to control break; - case SDLK_RIGHT: + case VK_RIGHT: if(HandleNavigation(DIRECTION_RIGHT)) continue; // Don't change value when enter Slider -> don't send event to control break; - case SDLK_PAGEDOWN: - case SDLK_HOME: + case VK_X: + case VK_A: event.key.keysym.sym = SDLK_RETURN; gui_input->pushInput(event); // Fire key down event.type = SDL_KEYUP; // and the key up diff --git a/src/od-pandora/gui/EditFilesysHardfile.cpp b/src/od-pandora/gui/EditFilesysHardfile.cpp index 28be7dc2..9a9d5efc 100644 --- a/src/od-pandora/gui/EditFilesysHardfile.cpp +++ b/src/od-pandora/gui/EditFilesysHardfile.cpp @@ -270,32 +270,32 @@ static void EditFilesysHardfileLoop(void) { switch(event.key.keysym.sym) { - case SDLK_ESCAPE: + case VK_ESCAPE: dialogFinished = true; break; - case SDLK_UP: + case VK_UP: if(HandleNavigation(DIRECTION_UP)) continue; // Don't change value when enter ComboBox -> don't send event to control break; - case SDLK_DOWN: + case VK_DOWN: if(HandleNavigation(DIRECTION_DOWN)) continue; // Don't change value when enter ComboBox -> don't send event to control break; - case SDLK_LEFT: + case VK_LEFT: if(HandleNavigation(DIRECTION_LEFT)) continue; // Don't change value when enter Slider -> don't send event to control break; - case SDLK_RIGHT: + case VK_RIGHT: if(HandleNavigation(DIRECTION_RIGHT)) continue; // Don't change value when enter Slider -> don't send event to control break; - case SDLK_PAGEDOWN: - case SDLK_HOME: + case VK_X: + case VK_A: event.key.keysym.sym = SDLK_RETURN; gui_input->pushInput(event); // Fire key down event.type = SDL_KEYUP; // and the key up diff --git a/src/od-pandora/gui/EditFilesysVirtual.cpp b/src/od-pandora/gui/EditFilesysVirtual.cpp index 32d5208a..3cd85f0d 100644 --- a/src/od-pandora/gui/EditFilesysVirtual.cpp +++ b/src/od-pandora/gui/EditFilesysVirtual.cpp @@ -210,32 +210,32 @@ static void EditFilesysVirtualLoop(void) { switch (event.key.keysym.sym) { - case SDLK_ESCAPE: + case VK_ESCAPE: dialogFinished = true; break; - case SDLK_UP: + case VK_UP: if (HandleNavigation(DIRECTION_UP)) continue; // Don't change value when enter ComboBox -> don't send event to control break; - case SDLK_DOWN: + case VK_DOWN: if (HandleNavigation(DIRECTION_DOWN)) continue; // Don't change value when enter ComboBox -> don't send event to control break; - case SDLK_LEFT: + case VK_LEFT: if (HandleNavigation(DIRECTION_LEFT)) continue; // Don't change value when enter Slider -> don't send event to control break; - case SDLK_RIGHT: + case VK_RIGHT: if (HandleNavigation(DIRECTION_RIGHT)) continue; // Don't change value when enter Slider -> don't send event to control break; - case SDLK_PAGEDOWN: - case SDLK_HOME: + case VK_X: + case VK_A: event.key.keysym.sym = SDLK_RETURN; gui_input->pushInput(event); // Fire key down event.type = SDL_KEYUP; // and the key up diff --git a/src/od-pandora/gui/InGameMessage.cpp b/src/od-pandora/gui/InGameMessage.cpp index c82b19fc..d4b7e871 100644 --- a/src/od-pandora/gui/InGameMessage.cpp +++ b/src/od-pandora/gui/InGameMessage.cpp @@ -104,8 +104,8 @@ void InGameMessage(const char *msg) { switch (event.key.keysym.sym) { - case SDLK_PAGEDOWN: - case SDLK_HOME: + case VK_X: + case VK_A: case SDLK_RETURN: msg_done = 1; break; diff --git a/src/od-pandora/gui/PanelInput.cpp b/src/od-pandora/gui/PanelInput.cpp index 68ba5270..0ac5964f 100644 --- a/src/od-pandora/gui/PanelInput.cpp +++ b/src/od-pandora/gui/PanelInput.cpp @@ -271,34 +271,34 @@ public: changed_prefs.pandora_customControls = chkCustomCtrl->isSelected() ? 1 : 0; else if (actionEvent.getSource() == cboA) - customControlMap[SDLK_HOME] = amigaKey[cboA->getSelected()]; + customControlMap[VK_A] = amigaKey[cboA->getSelected()]; else if (actionEvent.getSource() == cboB) - customControlMap[SDLK_END] = amigaKey[cboB->getSelected()]; + customControlMap[VK_B] = amigaKey[cboB->getSelected()]; else if (actionEvent.getSource() == cboX) - customControlMap[SDLK_PAGEDOWN] = amigaKey[cboX->getSelected()]; + customControlMap[VK_X] = amigaKey[cboX->getSelected()]; else if (actionEvent.getSource() == cboY) - customControlMap[SDLK_PAGEUP] = amigaKey[cboY->getSelected()]; + customControlMap[VK_Y] = amigaKey[cboY->getSelected()]; else if (actionEvent.getSource() == cboL) - customControlMap[SDLK_RSHIFT] = amigaKey[cboL->getSelected()]; + customControlMap[VK_L] = amigaKey[cboL->getSelected()]; else if (actionEvent.getSource() == cboR) - customControlMap[SDLK_RCTRL] = amigaKey[cboR->getSelected()]; + customControlMap[VK_R] = amigaKey[cboR->getSelected()]; else if (actionEvent.getSource() == cboUp) - customControlMap[SDLK_UP] = amigaKey[cboUp->getSelected()]; + customControlMap[VK_UP] = amigaKey[cboUp->getSelected()]; else if (actionEvent.getSource() == cboDown) - customControlMap[SDLK_DOWN] = amigaKey[cboDown->getSelected()]; + customControlMap[VK_DOWN] = amigaKey[cboDown->getSelected()]; else if (actionEvent.getSource() == cboLeft) - customControlMap[SDLK_LEFT] = amigaKey[cboLeft->getSelected()]; + customControlMap[VK_LEFT] = amigaKey[cboLeft->getSelected()]; else if (actionEvent.getSource() == cboRight) - customControlMap[SDLK_RIGHT] = amigaKey[cboRight->getSelected()]; + customControlMap[VK_RIGHT] = amigaKey[cboRight->getSelected()]; else if (actionEvent.getSource() == KeyForMenu) changed_prefs.key_for_menu = ControlKey_SDLKeyValues[KeyForMenu->getSelected()] ; @@ -660,16 +660,16 @@ void RefreshPanelInput(void) chkMouseHack->setSelected(changed_prefs.input_tablet == TABLET_MOUSEHACK); #endif chkCustomCtrl->setSelected(changed_prefs.pandora_customControls); - cboA->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_HOME])); - cboB->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_END])); - cboX->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_PAGEDOWN])); - cboY->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_PAGEUP])); - cboL->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_RSHIFT])); - cboR->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_RCTRL])); - cboUp->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_UP])); - cboDown->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_DOWN])); - cboLeft->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_LEFT])); - cboRight->setSelected(GetAmigaKeyIndex(customControlMap[SDLK_RIGHT])); + cboA->setSelected(GetAmigaKeyIndex(customControlMap[VK_A])); + cboB->setSelected(GetAmigaKeyIndex(customControlMap[VK_B])); + cboX->setSelected(GetAmigaKeyIndex(customControlMap[VK_X])); + cboY->setSelected(GetAmigaKeyIndex(customControlMap[VK_Y])); + cboL->setSelected(GetAmigaKeyIndex(customControlMap[VK_L])); + cboR->setSelected(GetAmigaKeyIndex(customControlMap[VK_R])); + cboUp->setSelected(GetAmigaKeyIndex(customControlMap[VK_UP])); + cboDown->setSelected(GetAmigaKeyIndex(customControlMap[VK_DOWN])); + cboLeft->setSelected(GetAmigaKeyIndex(customControlMap[VK_LEFT])); + cboRight->setSelected(GetAmigaKeyIndex(customControlMap[VK_RIGHT])); for(i=0; i<4; ++i) { diff --git a/src/od-pandora/gui/SelectFile.cpp b/src/od-pandora/gui/SelectFile.cpp index f61ac801..a7621038 100644 --- a/src/od-pandora/gui/SelectFile.cpp +++ b/src/od-pandora/gui/SelectFile.cpp @@ -288,11 +288,11 @@ static void SelectFileLoop(void) { switch (event.key.keysym.sym) { - case SDLK_ESCAPE: + case VK_ESCAPE: dialogFinished = true; break; - case SDLK_LEFT: + case VK_LEFT: { gcn::FocusHandler* focusHdl = gui_top->_getFocusHandler(); gcn::Widget* activeWidget = focusHdl->getFocused(); @@ -311,7 +311,7 @@ static void SelectFileLoop(void) } break; - case SDLK_RIGHT: + case VK_RIGHT: { gcn::FocusHandler* focusHdl = gui_top->_getFocusHandler(); gcn::Widget* activeWidget = focusHdl->getFocused(); @@ -330,8 +330,8 @@ static void SelectFileLoop(void) } break; - case SDLK_PAGEDOWN: - case SDLK_HOME: + case VK_X: + case VK_A: event.key.keysym.sym = SDLK_RETURN; gui_input->pushInput(event); // Fire key down event.type = SDL_KEYUP; // and the key up diff --git a/src/od-pandora/gui/SelectFolder.cpp b/src/od-pandora/gui/SelectFolder.cpp index c34163d4..b24486b3 100644 --- a/src/od-pandora/gui/SelectFolder.cpp +++ b/src/od-pandora/gui/SelectFolder.cpp @@ -200,11 +200,11 @@ static void SelectFolderLoop(void) { switch (event.key.keysym.sym) { - case SDLK_ESCAPE: + case VK_ESCAPE: dialogFinished = true; break; - case SDLK_LEFT: + case VK_LEFT: { gcn::FocusHandler* focusHdl = gui_top->_getFocusHandler(); gcn::Widget* activeWidget = focusHdl->getFocused(); @@ -218,7 +218,7 @@ static void SelectFolderLoop(void) } break; - case SDLK_RIGHT: + case VK_RIGHT: { gcn::FocusHandler* focusHdl = gui_top->_getFocusHandler(); gcn::Widget* activeWidget = focusHdl->getFocused(); @@ -232,8 +232,8 @@ static void SelectFolderLoop(void) } break; - case SDLK_PAGEDOWN: - case SDLK_HOME: + case VK_X: + case VK_A: event.key.keysym.sym = SDLK_RETURN; gui_input->pushInput(event); // Fire key down event.type = SDL_KEYUP; // and the key up diff --git a/src/od-pandora/gui/ShowMessage.cpp b/src/od-pandora/gui/ShowMessage.cpp index 18620c0b..65900e88 100644 --- a/src/od-pandora/gui/ShowMessage.cpp +++ b/src/od-pandora/gui/ShowMessage.cpp @@ -106,12 +106,12 @@ static void ShowMessageLoop(void) { switch(event.key.keysym.sym) { - case SDLK_ESCAPE: + case VK_ESCAPE: dialogFinished = true; break; - case SDLK_LEFT: - case SDLK_RIGHT: + case VK_LEFT: + case VK_RIGHT: { gcn::FocusHandler* focusHdl = gui_top->_getFocusHandler(); gcn::Widget* activeWidget = focusHdl->getFocused(); @@ -123,8 +123,8 @@ static void ShowMessageLoop(void) } break; - case SDLK_PAGEDOWN: - case SDLK_HOME: + case VK_X: + case VK_A: event.key.keysym.sym = SDLK_RETURN; gui_input->pushInput(event); // Fire key down event.type = SDL_KEYUP; // and the key up diff --git a/src/od-pandora/gui/main_window.cpp b/src/od-pandora/gui/main_window.cpp index bb807efa..4027e460 100644 --- a/src/od-pandora/gui/main_window.cpp +++ b/src/od-pandora/gui/main_window.cpp @@ -226,8 +226,8 @@ namespace sdl } break; - case SDLK_ESCAPE: - // case SDLK_RCTRL: + case VK_ESCAPE: + case VK_R: //------------------------------------------------- // Reset Amiga //------------------------------------------------- @@ -235,8 +235,8 @@ namespace sdl gui_running = false; break; - case SDLK_PAGEDOWN: - case SDLK_HOME: + case VK_X: + case VK_A: //------------------------------------------------ // Simulate press of enter when 'X' pressed //------------------------------------------------ @@ -245,22 +245,22 @@ namespace sdl event.type = SDL_KEYUP; // and the key up break; - case SDLK_UP: + case VK_UP: if(HandleNavigation(DIRECTION_UP)) continue; // Don't change value when enter ComboBox -> don't send event to control break; - case SDLK_DOWN: + case VK_DOWN: if(HandleNavigation(DIRECTION_DOWN)) continue; // Don't change value when enter ComboBox -> don't send event to control break; - case SDLK_LEFT: + case VK_LEFT: if(HandleNavigation(DIRECTION_LEFT)) continue; // Don't change value when enter Slider -> don't send event to control break; - case SDLK_RIGHT: + case VK_RIGHT: if(HandleNavigation(DIRECTION_RIGHT)) continue; // Don't change value when enter Slider -> don't send event to control break; diff --git a/src/od-pandora/keyboard.cpp b/src/od-pandora/keyboard.cpp index a5942746..805408df 100644 --- a/src/od-pandora/keyboard.cpp +++ b/src/od-pandora/keyboard.cpp @@ -322,7 +322,7 @@ static struct uae_input_device_kbr_default keytrans_amiga[] = { SDLK_TAB, INPUTEVENT_KEY_TAB }, { SDLK_RETURN, INPUTEVENT_KEY_RETURN }, { SDLK_SPACE, INPUTEVENT_KEY_SPACE }, - { SDLK_ESCAPE, INPUTEVENT_KEY_ESC }, + { VK_ESCAPE, INPUTEVENT_KEY_ESC }, { SDLK_INSERT, INPUTEVENT_KEY_HELP }, { SDLK_HOME, INPUTEVENT_KEY_HOME }, @@ -408,7 +408,7 @@ int translate_pandora_keys(int symbol, int *modifier) #endif switch(symbol) { - case SDLK_UP: + case VK_UP: if(*modifier == KMOD_RCTRL) // Right shoulder + dPad -> cursor keys { *modifier = KMOD_NONE; @@ -416,7 +416,7 @@ int translate_pandora_keys(int symbol, int *modifier) } break; - case SDLK_DOWN: + case VK_DOWN: if(*modifier == KMOD_RCTRL) // Right shoulder + dPad -> cursor keys { *modifier = KMOD_NONE; @@ -424,7 +424,7 @@ int translate_pandora_keys(int symbol, int *modifier) } break; - case SDLK_LEFT: + case VK_LEFT: if(*modifier == KMOD_RCTRL) // Right shoulder + dPad -> cursor keys { *modifier = KMOD_NONE; @@ -432,7 +432,7 @@ int translate_pandora_keys(int symbol, int *modifier) } break; - case SDLK_RIGHT: + case VK_RIGHT: if(*modifier == KMOD_RCTRL) // Right shoulder + dPad -> cursor keys { *modifier = KMOD_NONE; @@ -440,7 +440,7 @@ int translate_pandora_keys(int symbol, int *modifier) } break; - case SDLK_HOME: + case VK_A: if(*modifier == KMOD_RCTRL) // Right shoulder + button A -> CTRL { *modifier = KMOD_NONE; @@ -448,7 +448,7 @@ int translate_pandora_keys(int symbol, int *modifier) } break; - case SDLK_END: + case VK_B: if(*modifier == KMOD_RCTRL) // Right shoulder + button B -> left ALT { *modifier = KMOD_NONE; @@ -456,7 +456,7 @@ int translate_pandora_keys(int symbol, int *modifier) } break; - case SDLK_PAGEDOWN: + case VK_X: if(*modifier == KMOD_RCTRL) // Right shoulder + button X -> HELP { *modifier = KMOD_NONE; @@ -464,7 +464,7 @@ int translate_pandora_keys(int symbol, int *modifier) } break; - case SDLK_PAGEUP: // button Y -> Space + case VK_Y: // button Y -> Space *modifier = KMOD_NONE; return AK_SPC; diff --git a/src/od-pandora/menu/menu_config.cpp b/src/od-pandora/menu/menu_config.cpp index fc29f339..58d4f867 100644 --- a/src/od-pandora/menu/menu_config.cpp +++ b/src/od-pandora/menu/menu_config.cpp @@ -486,16 +486,16 @@ int loadconfig_old(struct uae_prefs *p, const char *orgpath) fscanf(f, "cutRight=%d\n", &dummy); fscanf(f, "customControls=%d\n", &p->pandora_customControls); fscanf(f, "custom_dpad=%d\n", &dummy); - fscanf(f, "custom_up=%d\n", &customControlMap[SDLK_UP]); - fscanf(f, "custom_down=%d\n", &customControlMap[SDLK_DOWN]); - fscanf(f, "custom_left=%d\n", &customControlMap[SDLK_LEFT]); - fscanf(f, "custom_right=%d\n", &customControlMap[SDLK_RIGHT]); - fscanf(f, "custom_A=%d\n", &customControlMap[SDLK_HOME]); - fscanf(f, "custom_B=%d\n", &customControlMap[SDLK_END]); - fscanf(f, "custom_X=%d\n", &customControlMap[SDLK_PAGEDOWN]); - fscanf(f, "custom_Y=%d\n", &customControlMap[SDLK_PAGEUP]); - fscanf(f, "custom_L=%d\n", &customControlMap[SDLK_RSHIFT]); - fscanf(f, "custom_R=%d\n", &customControlMap[SDLK_RCTRL]); + fscanf(f, "custom_up=%d\n", &customControlMap[VK_UP]); + fscanf(f, "custom_down=%d\n", &customControlMap[VK_DOWN]); + fscanf(f, "custom_left=%d\n", &customControlMap[VK_LEFT]); + fscanf(f, "custom_right=%d\n", &customControlMap[VK_RIGHT]); + fscanf(f, "custom_A=%d\n", &customControlMap[VK_A]); + fscanf(f, "custom_B=%d\n", &customControlMap[VK_B]); + fscanf(f, "custom_X=%d\n", &customControlMap[VK_X]); + fscanf(f, "custom_Y=%d\n", &customControlMap[VK_Y]); + fscanf(f, "custom_L=%d\n", &customControlMap[VK_L]); + fscanf(f, "custom_R=%d\n", &customControlMap[VK_R]); fscanf(f, "cpu=%d\n", &cpu_level); if (cpu_level > 0) // M68000 // Was old format diff --git a/src/od-pandora/pandora.cpp b/src/od-pandora/pandora.cpp index f6436b16..8fbac452 100644 --- a/src/od-pandora/pandora.cpp +++ b/src/od-pandora/pandora.cpp @@ -271,16 +271,16 @@ void target_save_options (struct zfile *f, struct uae_prefs *p) cfgfile_write (f, "pandora.hide_idle_led", "%d", p->pandora_hide_idle_led); cfgfile_write (f, "pandora.tap_delay", "%d", p->pandora_tapDelay); cfgfile_write (f, "pandora.custom_controls", "%d", p->pandora_customControls); - cfgfile_write (f, "pandora.custom_up", "%d", customControlMap[SDLK_UP]); - cfgfile_write (f, "pandora.custom_down", "%d", customControlMap[SDLK_DOWN]); - cfgfile_write (f, "pandora.custom_left", "%d", customControlMap[SDLK_LEFT]); - cfgfile_write (f, "pandora.custom_right", "%d", customControlMap[SDLK_RIGHT]); - cfgfile_write (f, "pandora.custom_a", "%d", customControlMap[SDLK_HOME]); - cfgfile_write (f, "pandora.custom_b", "%d", customControlMap[SDLK_END]); - cfgfile_write (f, "pandora.custom_x", "%d", customControlMap[SDLK_PAGEDOWN]); - cfgfile_write (f, "pandora.custom_y", "%d", customControlMap[SDLK_PAGEUP]); - cfgfile_write (f, "pandora.custom_l", "%d", customControlMap[SDLK_RSHIFT]); - cfgfile_write (f, "pandora.custom_r", "%d", customControlMap[SDLK_RCTRL]); + cfgfile_write (f, "pandora.custom_up", "%d", customControlMap[VK_UP]); + cfgfile_write (f, "pandora.custom_down", "%d", customControlMap[VK_DOWN]); + cfgfile_write (f, "pandora.custom_left", "%d", customControlMap[VK_LEFT]); + cfgfile_write (f, "pandora.custom_right", "%d", customControlMap[VK_RIGHT]); + cfgfile_write (f, "pandora.custom_a", "%d", customControlMap[VK_A]); + cfgfile_write (f, "pandora.custom_b", "%d", customControlMap[VK_B]); + cfgfile_write (f, "pandora.custom_x", "%d", customControlMap[VK_X]); + cfgfile_write (f, "pandora.custom_y", "%d", customControlMap[VK_Y]); + cfgfile_write (f, "pandora.custom_l", "%d", customControlMap[VK_L]); + cfgfile_write (f, "pandora.custom_r", "%d", customControlMap[VK_R]); cfgfile_write (f, "pandora.move_x", "%d", p->pandora_horizontal_offset); cfgfile_write (f, "pandora.move_y", "%d", p->pandora_vertical_offset); } @@ -302,16 +302,16 @@ int target_parse_option (struct uae_prefs *p, const char *option, const char *va || cfgfile_intval (option, value, "hide_idle_led", &p->pandora_hide_idle_led, 1) || cfgfile_intval (option, value, "tap_delay", &p->pandora_tapDelay, 1) || cfgfile_intval (option, value, "custom_controls", &p->pandora_customControls, 1) - || cfgfile_intval (option, value, "custom_up", &customControlMap[SDLK_UP], 1) - || cfgfile_intval (option, value, "custom_down", &customControlMap[SDLK_DOWN], 1) - || cfgfile_intval (option, value, "custom_left", &customControlMap[SDLK_LEFT], 1) - || cfgfile_intval (option, value, "custom_right", &customControlMap[SDLK_RIGHT], 1) - || cfgfile_intval (option, value, "custom_a", &customControlMap[SDLK_HOME], 1) - || cfgfile_intval (option, value, "custom_b", &customControlMap[SDLK_END], 1) - || cfgfile_intval (option, value, "custom_x", &customControlMap[SDLK_PAGEDOWN], 1) - || cfgfile_intval (option, value, "custom_y", &customControlMap[SDLK_PAGEUP], 1) - || cfgfile_intval (option, value, "custom_l", &customControlMap[SDLK_RSHIFT], 1) - || cfgfile_intval (option, value, "custom_r", &customControlMap[SDLK_RCTRL], 1) + || cfgfile_intval (option, value, "custom_up", &customControlMap[VK_UP], 1) + || cfgfile_intval (option, value, "custom_down", &customControlMap[VK_DOWN], 1) + || cfgfile_intval (option, value, "custom_left", &customControlMap[VK_LEFT], 1) + || cfgfile_intval (option, value, "custom_right", &customControlMap[VK_RIGHT], 1) + || cfgfile_intval (option, value, "custom_a", &customControlMap[VK_A], 1) + || cfgfile_intval (option, value, "custom_b", &customControlMap[VK_B], 1) + || cfgfile_intval (option, value, "custom_x", &customControlMap[VK_X], 1) + || cfgfile_intval (option, value, "custom_y", &customControlMap[VK_Y], 1) + || cfgfile_intval (option, value, "custom_l", &customControlMap[VK_L], 1) + || cfgfile_intval (option, value, "custom_r", &customControlMap[VK_R], 1) || cfgfile_intval (option, value, "move_x", &p->pandora_horizontal_offset, 1) || cfgfile_intval (option, value, "move_y", &p->pandora_vertical_offset, 1) ); @@ -906,8 +906,8 @@ int handle_msgpump (void) inputdevice_do_keyboard(AK_LSH, 1); break; - case SDLK_RSHIFT: // Left shoulder button - case SDLK_RCTRL: // Right shoulder button + case VK_L: // Left shoulder button + case VK_R: // Right shoulder button if(currprefs.input_tablet > TABLET_OFF) { // Holding left or right shoulder button -> stylus does right mousebutton @@ -985,8 +985,8 @@ int handle_msgpump (void) inputdevice_do_keyboard(AK_LSH, 0); break; - case SDLK_RSHIFT: // Left shoulder button - case SDLK_RCTRL: // Right shoulder button + case VK_L: // Left shoulder button + case VK_R: // Right shoulder button if(currprefs.input_tablet > TABLET_OFF) { // Release left or right shoulder button -> stylus does left mousebutton diff --git a/src/od-pandora/pandora_input.cpp b/src/od-pandora/pandora_input.cpp index 29117742..e7b0012b 100644 --- a/src/od-pandora/pandora_input.cpp +++ b/src/od-pandora/pandora_input.cpp @@ -1,5 +1,6 @@ #include "sysconfig.h" #include "sysdeps.h" +#include "config.h" #include "options.h" #include "keyboard.h" #include "inputdevice.h" @@ -118,19 +119,19 @@ static void read_mouse(void) Uint8 *keystate = SDL_GetKeyState(NULL); int mouseScale = currprefs.input_joymouse_multiplier / 4; - if (keystate[SDLK_LEFT]) + if (keystate[VK_LEFT]) setmousestate(1, 0, -mouseScale, 0); - if (keystate[SDLK_RIGHT]) + if (keystate[VK_RIGHT]) setmousestate(1, 0, mouseScale, 0); - if (keystate[SDLK_UP]) + if (keystate[VK_UP]) setmousestate(1, 1, -mouseScale, 0); - if (keystate[SDLK_DOWN]) + if (keystate[VK_DOWN]) setmousestate(1, 1, mouseScale, 0); if (!mouseBut1viaCustom) - setmousebuttonstate(1, 0, keystate[SDLK_HOME]); // A button -> left mouse + setmousebuttonstate(1, 0, keystate[VK_A]); // A button -> left mouse if (!mouseBut2viaCustom) - setmousebuttonstate(1, 1, keystate[SDLK_END]); // B button -> right mouse + setmousebuttonstate(1, 1, keystate[VK_B]); // B button -> right mouse } // Nubs as mouse handled in handle_msgpump() @@ -446,31 +447,31 @@ static void read_joystick(void) { Uint8 *keystate = SDL_GetKeyState(NULL); - if (!keystate[SDLK_RCTRL]) + if (!keystate[VK_R]) { // Right shoulder + dPad -> cursor keys - int axis = (keystate[SDLK_LEFT] ? -32767 : (keystate[SDLK_RIGHT] ? 32767 : 0)); + int axis = (keystate[VK_LEFT] ? -32767 : (keystate[VK_RIGHT] ? 32767 : 0)); if (!joyXviaCustom) setjoystickstate(0, 0, axis, 32767); - axis = (keystate[SDLK_UP] ? -32767 : (keystate[SDLK_DOWN] ? 32767 : 0)); + axis = (keystate[VK_UP] ? -32767 : (keystate[VK_DOWN] ? 32767 : 0)); if (!joyYviaCustom) setjoystickstate(0, 1, axis, 32767); } if (!joyButXviaCustom[0]) - setjoybuttonstate(0, 0, keystate[SDLK_PAGEDOWN]); + setjoybuttonstate(0, 0, keystate[VK_X]); if (!joyButXviaCustom[1]) - setjoybuttonstate(0, 1, keystate[SDLK_END]); + setjoybuttonstate(0, 1, keystate[VK_B]); if (!joyButXviaCustom[2]) - setjoybuttonstate(0, 2, keystate[SDLK_HOME]); + setjoybuttonstate(0, 2, keystate[VK_A]); if (!joyButXviaCustom[3]) - setjoybuttonstate(0, 3, keystate[SDLK_PAGEUP]); + setjoybuttonstate(0, 3, keystate[VK_Y]); int cd32_start = 0, cd32_ffw = 0, cd32_rwd = 0; if (keystate[SDLK_LALT]) // Pandora Start button { - if (keystate[SDLK_RSHIFT]) // Left shoulder + if (keystate[VK_L]) // Left shoulder cd32_rwd = 1; - else if (keystate[SDLK_RCTRL]) // Right shoulder + else if (keystate[VK_R]) // Right shoulder cd32_ffw = 1; else cd32_start = 1;