LilyPad: Remove outdated hacks

Removes Ignore Key(hasn't functioned since LilyPad 0.9.9 (PCSX2 0.9.6)),
and "Send escape on window close" hack (unnecessary for PCSX2 and caused
issues with other emulators).
This commit is contained in:
FlatOutPS2 2017-01-26 19:13:05 +01:00
parent 9163ed351c
commit 6e54dfe5ba
7 changed files with 29 additions and 73 deletions

View File

@ -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.disableScreenSaver = 0; // Not required - handled internally by PCSX2
config_in_out.escapeFullscreenHack = 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.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 // Dialog widgets which should be disabled - mostly matching PCSX2_overrideConfig
@ -59,8 +59,7 @@ const UINT *PCSX2_disabledWidgets()
IDC_ESCAPE_FULLSCREEN_HACK, IDC_ESCAPE_FULLSCREEN_HACK,
IDC_SAVE_STATE_TITLE, IDC_SAVE_STATE_TITLE,
IDC_ANALOG_START1, // start in analog mode - only useful for PS1 IDC_ANALOG_START1, // start in analog mode - only useful for PS1
IDC_CLOSE_HACK1, IDC_CLOSE_HACK,
IDC_CLOSE_HACK2,
0}; 0};
return disabledWidgets; return disabledWidgets;
} }
@ -328,8 +327,6 @@ wchar_t *GetCommandStringW(u8 command, int port, int slot)
int res = GetWindowTextW(hWnd, temp, 20); int res = GetWindowTextW(hWnd, temp, 20);
if ((unsigned int)res - 1 <= 18) if ((unsigned int)res - 1 <= 18)
return temp; return temp;
} else if (command == 0x7F) {
return L"Ignore Key";
} }
return L""; return L"";
} }
@ -450,26 +447,22 @@ void SelChanged(int port, int slot)
if (b) { if (b) {
bFound++; bFound++;
VirtualControl *control = &dev->virtualControls[b->controlIndex]; VirtualControl *control = &dev->virtualControls[b->controlIndex];
// Ignore // Only relative axes can't have negative sensitivity.
if (b->command != 0x7F) { if (((control->uid >> 16) & 0xFF) == RELAXIS) {
// 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
disableFlip = 1; 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 } else
ffbFound++; ffbFound++;
} }
@ -873,7 +866,7 @@ int SaveSettings(wchar_t *file = 0)
for (int i = 0; i < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); i++) { for (int i = 0; i < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); i++) {
noError &= WritePrivateProfileInt(L"General Settings", BoolOptionsInfo[i].name, config.bools[i], file); 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"Keyboard Mode", config.keyboardApi, file);
WritePrivateProfileInt(L"General Settings", L"Mouse Mode", config.mouseApi, 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++) { 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.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); config.closeHack = (u8)GetPrivateProfileIntW(L"General Settings", L"Close Hack", 0, file);
if (config.closeHacks & 1)
config.closeHacks &= ~2;
config.keyboardApi = (DeviceAPI)GetPrivateProfileIntW(L"General Settings", L"Keyboard Mode", WM, file); config.keyboardApi = (DeviceAPI)GetPrivateProfileIntW(L"General Settings", L"Keyboard Mode", WM, file);
if (!config.keyboardApi) 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_SENSITIVITY));
SetupLogSlider(GetDlgItem(hWnd, IDC_SLIDER_DEADZONE)); SetupLogSlider(GetDlgItem(hWnd, IDC_SLIDER_DEADZONE));
SetupLogSlider(GetDlgItem(hWnd, IDC_SLIDER_SKIP_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); CheckDlgButton(hWnd, IDC_CONFIGURE_ON_BIND, BST_CHECKED * config.configureOnBind);
AddTooltip(IDC_BINDINGS_LIST, hWnd); 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(IDC_CONFIGURE_ON_BIND, hWnd);
AddTooltip(ID_MOUSE, hWnd); AddTooltip(ID_MOUSE, hWnd);
AddTooltip(ID_ANALOG, hWnd); AddTooltip(ID_ANALOG, hWnd);
AddTooltip(ID_IGNORE, hWnd);
AddTooltip(ID_LOCK_ALL_INPUT, hWnd); AddTooltip(ID_LOCK_ALL_INPUT, hWnd);
AddTooltip(ID_LOCK_DIRECTION, hWnd); AddTooltip(ID_LOCK_DIRECTION, hWnd);
AddTooltip(ID_LOCK_BUTTONS, 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); 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. // Messes up things, unfortunately.
// End binding on a bunch of notification messages, and // End binding on a bunch of notification messages, and
// this will send a bunch. // this will send a bunch.
// UnselectAll(hWndList); // UnselectAll(hWndList);
EndBinding(hWnd); EndBinding(hWnd);
if (cmd != ID_IGNORE) { selected = cmd - (ID_SELECT - 0x10);
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);
}
}
}
hWndButtonProc.SetWndHandle(GetDlgItem(hWnd, cmd)); hWndButtonProc.SetWndHandle(GetDlgItem(hWnd, cmd));
hWndButtonProc.Eat(DoNothingWndProc, 0); 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++) { for (int j = 0; j < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); j++) {
CheckDlgButton(hWnd, BoolOptionsInfo[j].ControlId, BST_CHECKED * config.bools[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_HACK, BST_CHECKED * config.closeHack);
CheckDlgButton(hWnd, IDC_CLOSE_HACK2, BST_CHECKED * ((config.closeHacks & 2) >> 1));
AddTooltip(IDC_M_WM, hWnd); AddTooltip(IDC_M_WM, hWnd);
AddTooltip(IDC_M_RAW, 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); config.padConfigs[port][slot].autoAnalog = (IsDlgButtonChecked(hWnd, IDC_ANALOG_START1) == BST_CHECKED);
PropSheet_Changed(hWndProp, hWnd); PropSheet_Changed(hWndProp, hWnd);
} else { } 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]; int mtap = config.multitap[0] + 2 * config.multitap[1];
for (int j = 0; j < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); j++) { for (int j = 0; j < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); j++) {
config.bools[j] = (IsDlgButtonChecked(hWnd, BoolOptionsInfo[j].ControlId) == BST_CHECKED); config.bools[j] = (IsDlgButtonChecked(hWnd, BoolOptionsInfo[j].ControlId) == BST_CHECKED);
} }
config.closeHacks = (IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK1) == BST_CHECKED) | config.closeHack = IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK) == BST_CHECKED;
((IsDlgButtonChecked(hWnd, IDC_CLOSE_HACK2) == BST_CHECKED) << 1);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
if (i && IsDlgButtonChecked(hWnd, IDC_KB_DISABLE + i) == BST_CHECKED) { if (i && IsDlgButtonChecked(hWnd, IDC_KB_DISABLE + i) == BST_CHECKED) {

View File

@ -35,13 +35,12 @@ public:
int deviceSelect[2][4]; int deviceSelect[2][4];
u8 closeHacks; u8 closeHack;
DeviceAPI keyboardApi; DeviceAPI keyboardApi;
DeviceAPI mouseApi; DeviceAPI mouseApi;
// Derived value, calculated by GetInput(). // Derived value, calculated by GetInput().
u8 ignoreKeys;
u8 configureOnBind; u8 configureOnBind;
bool bind; bool bind;

View File

@ -16,7 +16,7 @@ Logging=0
Save State in Title=0 Save State in Title=0
GH2=0 GH2=0
Turbo Key Hack=0 Turbo Key Hack=0
Close Hacks=0 Close Hack=0
Keyboard Mode=2 Keyboard Mode=2
Mouse Mode=0 Mouse Mode=0
[Pad Settings] [Pad Settings]

View File

@ -970,10 +970,7 @@ ExtraWndProcResult StatusWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPa
PrepareActivityState(LOWORD(wParam) != WA_INACTIVE); PrepareActivityState(LOWORD(wParam) != WA_INACTIVE);
break; break;
case WM_CLOSE: case WM_CLOSE:
if (config.closeHacks & 1) { if (config.closeHack) {
QueueKeyEvent(VK_ESCAPE, KEYPRESS);
return NO_WND_PROC;
} else if (config.closeHacks & 2) {
ExitProcess(0); ExitProcess(0);
return NO_WND_PROC; return NO_WND_PROC;
} }

View File

@ -229,7 +229,7 @@ int SaveSettings(wchar_t *file = 0)
for (size_t i = 0; i < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); i++) { for (size_t i = 0; i < sizeof(BoolOptionsInfo) / sizeof(BoolOptionsInfo[0]); i++) {
cfg.WriteBool(L"General Settings", BoolOptionsInfo[i].name, config.bools[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"Keyboard Mode", config.keyboardApi);
cfg.WriteInt(L"General Settings", L"Mouse Mode", config.mouseApi); 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.bools[i] = cfg.ReadBool(L"General Settings", BoolOptionsInfo[i].name, BoolOptionsInfo[i].defaultValue);
} }
config.closeHack = (u8)cfg.ReadInt(L"General Settings", L"Close Hack");
config.closeHacks = (u8)cfg.ReadInt(L"General Settings", L"Close Hacks");
if (config.closeHacks & 1)
config.closeHacks &= ~2;
config.keyboardApi = (DeviceAPI)cfg.ReadInt(L"General Settings", L"Keyboard Mode", LNX_KEYBOARD); config.keyboardApi = (DeviceAPI)cfg.ReadInt(L"General Settings", L"Keyboard Mode", LNX_KEYBOARD);
if (!config.keyboardApi) if (!config.keyboardApi)

View File

@ -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 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"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"; 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: 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. " 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."; L"Pressing it again releases the old pad state, if the old pad state had any keys pressed. Otherwise, it's released automatically.";

View File

@ -15,7 +15,6 @@
#define IDD_CONFIG_POPN 112 #define IDD_CONFIG_POPN 112
#define IDD_CONFIG_PS1_MOUSE 113 #define IDD_CONFIG_PS1_MOUSE 113
#define IDD_CONFIG_NEGCON 114 #define IDD_CONFIG_NEGCON 114
#define IDC_CLOSE_HACK1 1099
#define IDC_KB_DISABLE 1100 #define IDC_KB_DISABLE 1100
#define IDC_KB_DI 1101 #define IDC_KB_DI 1101
#define IDC_KB_WM 1102 #define IDC_KB_WM 1102
@ -28,7 +27,7 @@
#define IDC_G_XI 1109 #define IDC_G_XI 1109
#define IDC_G_DI 1110 #define IDC_G_DI 1110
#define IDC_G_DS3 1111 #define IDC_G_DS3 1111
#define IDC_CLOSE_HACK2 1112 #define IDC_CLOSE_HACK 1112
#define IDC_DEBUG_FILE 1113 #define IDC_DEBUG_FILE 1113
#define IDC_GUITAR1 1114 #define IDC_GUITAR1 1114
#define IDC_ANALOG_START1 1115 #define IDC_ANALOG_START1 1115
@ -98,7 +97,6 @@
#define ID_RSTICK_LEFT 0x1117 #define ID_RSTICK_LEFT 0x1117
#define ID_ANALOG 0x1118 #define ID_ANALOG 0x1118
#define ID_EXCLUDE 0x1119 #define ID_EXCLUDE 0x1119
#define ID_IGNORE 0x111A
#define IDC_FORCEFEEDBACK 0x111B #define IDC_FORCEFEEDBACK 0x111B
#define IDC_FORCEFEEDBACK_FUNCTION 0x111C #define IDC_FORCEFEEDBACK_FUNCTION 0x111C
#define ID_BIG_MOTOR 0x111D #define ID_BIG_MOTOR 0x111D