diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index 6113d61630..78cf707e32 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -48,7 +48,7 @@ void PCSX2_overrideConfig(GeneralConfig &config_in_out) config_in_out.disableScreenSaver = 0; // Not required - handled internally by PCSX2 config_in_out.escapeFullscreenHack = 0; // Not required - handled internally by PCSX2 config_in_out.saveStateTitle = 0; // Not required - handled internally by PCSX2 - config_in_out.closeHacks = 0; // Cannot function when used by PCSX2 + config_in_out.closeHack = 0; // Cannot function when used by PCSX2 } // Dialog widgets which should be disabled - mostly matching PCSX2_overrideConfig @@ -59,8 +59,7 @@ const UINT *PCSX2_disabledWidgets() IDC_ESCAPE_FULLSCREEN_HACK, IDC_SAVE_STATE_TITLE, IDC_ANALOG_START1, // start in analog mode - only useful for PS1 - IDC_CLOSE_HACK1, - IDC_CLOSE_HACK2, + IDC_CLOSE_HACK, 0}; return disabledWidgets; } @@ -328,8 +327,6 @@ wchar_t *GetCommandStringW(u8 command, int port, int slot) int res = GetWindowTextW(hWnd, temp, 20); if ((unsigned int)res - 1 <= 18) return temp; - } else if (command == 0x7F) { - return L"Ignore Key"; } return L""; } @@ -450,26 +447,22 @@ void SelChanged(int port, int slot) if (b) { bFound++; VirtualControl *control = &dev->virtualControls[b->controlIndex]; - // Ignore - if (b->command != 0x7F) { - // Only relative axes can't have negative sensitivity. - if (((control->uid >> 16) & 0xFF) == RELAXIS) { - disableFlip = 1; - } - turbo += b->turbo; - if (b->sensitivity < 0) { - flipped++; - sensitivity -= b->sensitivity; - } else { - sensitivity += b->sensitivity; - } - if (((control->uid >> 16) & 0xFF) != PSHBTN && ((control->uid >> 16) & 0xFF) != TGLBTN) { - deadZone += b->deadZone; - skipDeadZone += b->skipDeadZone; - nonButtons++; - } - } else + // Only relative axes can't have negative sensitivity. + if (((control->uid >> 16) & 0xFF) == RELAXIS) { disableFlip = 1; + } + turbo += b->turbo; + if (b->sensitivity < 0) { + flipped++; + sensitivity -= b->sensitivity; + } else { + sensitivity += b->sensitivity; + } + if (((control->uid >> 16) & 0xFF) != PSHBTN && ((control->uid >> 16) & 0xFF) != TGLBTN) { + deadZone += b->deadZone; + skipDeadZone += b->skipDeadZone; + nonButtons++; + } } else ffbFound++; } @@ -873,7 +866,7 @@ int SaveSettings(wchar_t *file = 0) for (int i = 0; i < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); i++) { noError &= WritePrivateProfileInt(L"General Settings", BoolOptionsInfo[i].name, config.bools[i], file); } - WritePrivateProfileInt(L"General Settings", L"Close Hacks", config.closeHacks, file); + WritePrivateProfileInt(L"General Settings", L"Close Hack", config.closeHack, file); WritePrivateProfileInt(L"General Settings", L"Keyboard Mode", config.keyboardApi, file); WritePrivateProfileInt(L"General Settings", L"Mouse Mode", config.mouseApi, file); @@ -983,9 +976,7 @@ int LoadSettings(int force, wchar_t *file) for (int i = 0; i < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); i++) { config.bools[i] = GetPrivateProfileBool(L"General Settings", BoolOptionsInfo[i].name, BoolOptionsInfo[i].defaultValue, file); } - config.closeHacks = (u8)GetPrivateProfileIntW(L"General Settings", L"Close Hacks", 0, file); - if (config.closeHacks & 1) - config.closeHacks &= ~2; + config.closeHack = (u8)GetPrivateProfileIntW(L"General Settings", L"Close Hack", 0, file); config.keyboardApi = (DeviceAPI)GetPrivateProfileIntW(L"General Settings", L"Keyboard Mode", WM, file); if (!config.keyboardApi) @@ -1546,8 +1537,6 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l SetupLogSlider(GetDlgItem(hWnd, IDC_SLIDER_SENSITIVITY)); SetupLogSlider(GetDlgItem(hWnd, IDC_SLIDER_DEADZONE)); SetupLogSlider(GetDlgItem(hWnd, IDC_SLIDER_SKIP_DEADZONE)); - if (port || slot) - EnableWindow(GetDlgItem(hWnd, ID_IGNORE), 0); CheckDlgButton(hWnd, IDC_CONFIGURE_ON_BIND, BST_CHECKED * config.configureOnBind); AddTooltip(IDC_BINDINGS_LIST, hWnd); @@ -1555,7 +1544,6 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l AddTooltip(IDC_CONFIGURE_ON_BIND, hWnd); AddTooltip(ID_MOUSE, hWnd); AddTooltip(ID_ANALOG, hWnd); - AddTooltip(ID_IGNORE, hWnd); AddTooltip(ID_LOCK_ALL_INPUT, hWnd); AddTooltip(ID_LOCK_DIRECTION, hWnd); AddTooltip(ID_LOCK_BUTTONS, hWnd); @@ -1863,24 +1851,13 @@ INT_PTR CALLBACK DialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, LPARAM l SetTimer(hWnd, 1, 3000, 0); } } - } else if ((cmd >= ID_LOCK_BUTTONS && cmd <= ID_EXCLUDE) || cmd == ID_IGNORE) { // || cmd == ID_FORCE_FEEDBACK) { + } else if (cmd >= ID_LOCK_BUTTONS && cmd <= ID_EXCLUDE) { // || cmd == ID_FORCE_FEEDBACK) { // Messes up things, unfortunately. // End binding on a bunch of notification messages, and // this will send a bunch. // UnselectAll(hWndList); EndBinding(hWnd); - if (cmd != ID_IGNORE) { - selected = cmd - (ID_SELECT - 0x10); - } else { - selected = 0x7F; - for (int i = 0; i < dm->numDevices; i++) { - if (dm->devices[i]->api != IGNORE_KEYBOARD) { - dm->DisableDevice(i); - } else { - dm->EnableDevice(i); - } - } - } + selected = cmd - (ID_SELECT - 0x10); hWndButtonProc.SetWndHandle(GetDlgItem(hWnd, cmd)); hWndButtonProc.Eat(DoNothingWndProc, 0); @@ -2193,8 +2170,7 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L for (int j = 0; j < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); j++) { CheckDlgButton(hWnd, BoolOptionsInfo[j].ControlId, BST_CHECKED * config.bools[j]); } - CheckDlgButton(hWnd, IDC_CLOSE_HACK1, BST_CHECKED * (config.closeHacks & 1)); - CheckDlgButton(hWnd, IDC_CLOSE_HACK2, BST_CHECKED * ((config.closeHacks & 2) >> 1)); + CheckDlgButton(hWnd, IDC_CLOSE_HACK, BST_CHECKED * config.closeHack); AddTooltip(IDC_M_WM, hWnd); AddTooltip(IDC_M_RAW, hWnd); @@ -2278,21 +2254,13 @@ INT_PTR CALLBACK GeneralDialogProc(HWND hWnd, unsigned int msg, WPARAM wParam, L config.padConfigs[port][slot].autoAnalog = (IsDlgButtonChecked(hWnd, IDC_ANALOG_START1) == BST_CHECKED); PropSheet_Changed(hWndProp, hWnd); } else { - int t = IDC_CLOSE_HACK1; - int test = LOWORD(wParam); - if (test == IDC_CLOSE_HACK1) { - CheckDlgButton(hWnd, IDC_CLOSE_HACK2, BST_UNCHECKED); - } else if (test == IDC_CLOSE_HACK2) { - CheckDlgButton(hWnd, IDC_CLOSE_HACK1, BST_UNCHECKED); - } int mtap = config.multitap[0] + 2 * config.multitap[1]; for (int j = 0; j < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); j++) { config.bools[j] = (IsDlgButtonChecked(hWnd, BoolOptionsInfo[j].ControlId) == BST_CHECKED); } - config.closeHacks = (IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK1) == BST_CHECKED) | - ((IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK2) == BST_CHECKED) << 1); + config.closeHack = IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK) == BST_CHECKED; for (i = 0; i < 4; i++) { if (i && IsDlgButtonChecked(hWnd, IDC_KB_DISABLE + i) == BST_CHECKED) { diff --git a/plugins/LilyPad/Config.h b/plugins/LilyPad/Config.h index a348704e52..388c98cdc3 100644 --- a/plugins/LilyPad/Config.h +++ b/plugins/LilyPad/Config.h @@ -35,13 +35,12 @@ public: int deviceSelect[2][4]; - u8 closeHacks; + u8 closeHack; DeviceAPI keyboardApi; DeviceAPI mouseApi; // Derived value, calculated by GetInput(). - u8 ignoreKeys; u8 configureOnBind; bool bind; diff --git a/plugins/LilyPad/Default.ini b/plugins/LilyPad/Default.ini index 250584dc30..ec301ac513 100644 --- a/plugins/LilyPad/Default.ini +++ b/plugins/LilyPad/Default.ini @@ -16,7 +16,7 @@ Logging=0 Save State in Title=0 GH2=0 Turbo Key Hack=0 -Close Hacks=0 +Close Hack=0 Keyboard Mode=2 Mouse Mode=0 [Pad Settings] diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index c1d87f7c26..c41b657a8b 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -970,10 +970,7 @@ ExtraWndProcResult StatusWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa PrepareActivityState(LOWORD(wParam) != WA_INACTIVE); break; case WM_CLOSE: - if (config.closeHacks & 1) { - QueueKeyEvent(VK_ESCAPE, KEYPRESS); - return NO_WND_PROC; - } else if (config.closeHacks & 2) { + if (config.closeHack) { ExitProcess(0); return NO_WND_PROC; } diff --git a/plugins/LilyPad/Linux/Config.cpp b/plugins/LilyPad/Linux/Config.cpp index 50f1c83cb8..57761d487d 100644 --- a/plugins/LilyPad/Linux/Config.cpp +++ b/plugins/LilyPad/Linux/Config.cpp @@ -229,7 +229,7 @@ int SaveSettings(wchar_t *file = 0) for (size_t i = 0; i < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); i++) { cfg.WriteBool(L"General Settings", BoolOptionsInfo[i].name, config.bools[i]); } - cfg.WriteInt(L"General Settings", L"Close Hacks", config.closeHacks); + cfg.WriteInt(L"General Settings", L"Close Hack", config.closeHack); cfg.WriteInt(L"General Settings", L"Keyboard Mode", config.keyboardApi); cfg.WriteInt(L"General Settings", L"Mouse Mode", config.mouseApi); @@ -319,10 +319,7 @@ int LoadSettings(int force, wchar_t *file) config.bools[i] = cfg.ReadBool(L"General Settings", BoolOptionsInfo[i].name, BoolOptionsInfo[i].defaultValue); } - - config.closeHacks = (u8)cfg.ReadInt(L"General Settings", L"Close Hacks"); - if (config.closeHacks & 1) - config.closeHacks &= ~2; + config.closeHack = (u8)cfg.ReadInt(L"General Settings", L"Close Hack"); config.keyboardApi = (DeviceAPI)cfg.ReadInt(L"General Settings", L"Keyboard Mode", LNX_KEYBOARD); if (!config.keyboardApi) diff --git a/plugins/LilyPad/Tooltips.cpp b/plugins/LilyPad/Tooltips.cpp index ee0206903e..2cf23e23d2 100644 --- a/plugins/LilyPad/Tooltips.cpp +++ b/plugins/LilyPad/Tooltips.cpp @@ -88,9 +88,6 @@ LPWSTR dialog_message(int ID, bool *updateText) L"This option is useful when analog mode is enabled in a game that does not support it, as this causes the game to not recognise any input or to not even detect a controller.\n\n" L"This option can also be used to enable analog mode in games that support, but do not automatically enable analog mode.\n\n" L"Note: Analog mode enables the analog sticks to function on a DualShock controller, while in digital mode it behaves as an original PlayStation controller.\n\n"; - case ID_IGNORE: - return L"Blocks the assigned keyboard button and does not pass it on to PCSX2. It currently cannot block the windows key (for unknown reasons).\n\n" - L"Ignored keys are listed with pad 1's bindings. You do not have to configure ignored keys again when you change the keyboard input mode."; case ID_LOCK_ALL_INPUT: return L"Locks the current state of the pad. Any further input is handled normally, but the initial pad state is the locked state instead of a state with no buttons pressed. " L"Pressing it again releases the old pad state, if the old pad state had any keys pressed. Otherwise, it's released automatically."; diff --git a/plugins/LilyPad/resource.h b/plugins/LilyPad/resource.h index fb76c29110..5214368d85 100644 --- a/plugins/LilyPad/resource.h +++ b/plugins/LilyPad/resource.h @@ -15,7 +15,6 @@ #define IDD_CONFIG_POPN 112 #define IDD_CONFIG_PS1_MOUSE 113 #define IDD_CONFIG_NEGCON 114 -#define IDC_CLOSE_HACK1 1099 #define IDC_KB_DISABLE 1100 #define IDC_KB_DI 1101 #define IDC_KB_WM 1102 @@ -28,7 +27,7 @@ #define IDC_G_XI 1109 #define IDC_G_DI 1110 #define IDC_G_DS3 1111 -#define IDC_CLOSE_HACK2 1112 +#define IDC_CLOSE_HACK 1112 #define IDC_DEBUG_FILE 1113 #define IDC_GUITAR1 1114 #define IDC_ANALOG_START1 1115 @@ -98,7 +97,6 @@ #define ID_RSTICK_LEFT 0x1117 #define ID_ANALOG 0x1118 #define ID_EXCLUDE 0x1119 -#define ID_IGNORE 0x111A #define IDC_FORCEFEEDBACK 0x111B #define IDC_FORCEFEEDBACK_FUNCTION 0x111C #define ID_BIG_MOTOR 0x111D