diff --git a/plugins/LilyPad/Config.cpp b/plugins/LilyPad/Config.cpp index 13c92d2677..21d3855697 100644 --- a/plugins/LilyPad/Config.cpp +++ b/plugins/LilyPad/Config.cpp @@ -20,6 +20,9 @@ GeneralConfig config; +// 1 if running inside a PS2 emulator. Set to 1 on any +// of the PS2-specific functions (PS2EgetLibVersion2, PS2EgetLibType). +// Only affects if I allow read input in GS thread to be set. u8 ps2e = 0; HWND hWndProp = 0; diff --git a/plugins/LilyPad/InputManager.cpp b/plugins/LilyPad/InputManager.cpp index f3eb83bbce..bb3c5cacbf 100644 --- a/plugins/LilyPad/InputManager.cpp +++ b/plugins/LilyPad/InputManager.cpp @@ -428,7 +428,6 @@ void InputDeviceManager::DisableAllDevices() { void InputDeviceManager::DisableDevice(int index) { devices[index]->enabled = 0; - // Should never happen, but just in case... if (devices[index]->active) devices[index]->Deactivate(); } diff --git a/plugins/LilyPad/LilyPad.cpp b/plugins/LilyPad/LilyPad.cpp index 9c979ae75e..68f71ca6a3 100644 --- a/plugins/LilyPad/LilyPad.cpp +++ b/plugins/LilyPad/LilyPad.cpp @@ -106,8 +106,6 @@ class Pad { public: ButtonSum sum, lockedSum; - Stick rStick, lStick; - int lockedState; u8 vibrate[8]; @@ -497,6 +495,7 @@ u32 CALLBACK PS2EgetLibVersion2(u32 type) { return 0; } +// Used in about and config screens. void GetNameAndVersionString(wchar_t *out) { #ifdef _DEBUG wsprintfW(out, L"LilyPad Debug %i.%i.%i (r%i)", (VERSION>>8)&0xFF, VERSION&0xFF, (VERSION>>24)&0xFF, SVN_REV); @@ -1089,6 +1088,19 @@ DWORD WINAPI RenameWindowThreadProc(void *lpParameter) { return 0; } +/*DWORD WINAPI MaximizeWindowThreadProc(void *lpParameter) { + while ((HWND)lpParameter == hWnd || hWnd) { + Sleep(10); + } + Sleep(100); + keybd_event(VK_LMENU, MapVirtualKey(VK_LMENU, MAPVK_VK_TO_VSC), 0, 0); + keybd_event(VK_RETURN, MapVirtualKey(VK_RETURN, MAPVK_VK_TO_VSC), 0, 0); + Sleep(10); + keybd_event(VK_RETURN, MapVirtualKey(VK_RETURN, MAPVK_VK_TO_VSC), KEYEVENTF_KEYUP, 0); + keybd_event(VK_LMENU, MapVirtualKey(VK_LMENU, MAPVK_VK_TO_VSC), KEYEVENTF_KEYUP, 0); + return 0; +}//*/ + keyEvent* CALLBACK PADkeyEvent() { if (!config.GSThreadUpdates) { Update(2); @@ -1096,13 +1108,32 @@ keyEvent* CALLBACK PADkeyEvent() { static int shiftDown = 0; static keyEvent ev; if (!GetQueuedKeyEvent(&ev)) return 0; - if (ev.key == VK_ESCAPE && ev.evt == KEYPRESS && config.escapeFullscreenHack) { + if ((ev.key == VK_ESCAPE || ev.key == -2) && ev.evt == KEYPRESS && config.escapeFullscreenHack) { if (IsWindowMaximized(hWnd)) { - EatWndProc(hWnd, KillFullScreenProc); + QueueKeyEvent(-2, KEYPRESS); + if (ev.key != -2) + EatWndProc(hWnd, KillFullScreenProc); return 0; } + ev.key = VK_ESCAPE; } + /* + if ((ev.key == VK_F9 || ev.key == -1) && ev.evt == KEYPRESS) { + if (IsWindowMaximized(hWnd)) { + QueueKeyEvent(-1, KEYPRESS); + if (ev.key == VK_F9) + EatWndProc(hWnd, KillFullScreenProc); + return 0; + } + return 0; + if (ev.key == -1) { + HANDLE hThread = CreateThread(0, 0, MaximizeWindowThreadProc, hWnd, 0, 0); + if (hThread) CloseHandle(hThread); + } + ev.key = VK_F9; + }//*/ + if (ev.key == VK_F2 && ev.evt == KEYPRESS) { saveStateIndex += 1 - 2*shiftDown; saveStateIndex = (saveStateIndex+10)%10; @@ -1157,7 +1188,7 @@ u32 CALLBACK PSEgetLibVersion() { } // Little funkiness to handle rounding floating points to ints without the C runtime. -// Unfortunately, means I can't use /GL optimization option. +// Unfortunately, means I can't use /GL optimization option when NO_CRT is defined. #ifdef NO_CRT extern "C" long _cdecl _ftol(); extern "C" long _cdecl _ftol2_sse() { diff --git a/plugins/LilyPad/LilyPad.rc b/plugins/LilyPad/LilyPad.rc index a5357a251f..114488872f 100644 --- a/plugins/LilyPad/LilyPad.rc +++ b/plugins/LilyPad/LilyPad.rc @@ -27,18 +27,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // TEXTINCLUDE // -1 TEXTINCLUDE +1 TEXTINCLUDE BEGIN "resource.h\0" END -2 TEXTINCLUDE +2 TEXTINCLUDE BEGIN "#include \r\n" "\0" END -3 TEXTINCLUDE +3 TEXTINCLUDE BEGIN "\r\n" "\0" @@ -264,17 +264,18 @@ BEGIN GROUPBOX "Hacks",IDC_STATIC,216,211,201,73 CONTROL "Send escape on window close",IDC_CLOSE_HACK1,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,223,113,10 CONTROL "Exit emulator on window close",IDC_CLOSE_HACK2,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,235,112,10 - CONTROL "Safe fullscreen exit on escape",IDC_ESCAPE_FULLSCREEN_HACK, - "Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,247,112,10 - CONTROL "Always hide cursor",IDC_FORCE_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,259,71,10 - CONTROL "Disable screensaver",IDC_DISABLE_SCREENSAVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,224,271,80,10 - CONTROL "Guitar Hero 2 Hack",IDC_GH2_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,223,76,10 - CONTROL "Use GS thread",IDC_GS_THREAD_INPUT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,235,62,10 + CONTROL "Safe fullscreen exit on escape\n(Doesn't like GSDX with DX9)",IDC_ESCAPE_FULLSCREEN_HACK, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,224,247,110,18 + CONTROL "Use GS thread\n(Recommended)",IDC_GS_THREAD_INPUT, + "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,224,265,107,16 + CONTROL "Disable screensaver",IDC_DISABLE_SCREENSAVER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,223,80,10 + CONTROL "Always hide cursor",IDC_FORCE_HIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,235,71,10 CONTROL "Save state # in title",IDC_SAVE_STATE_TITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,247,79,10 + CONTROL "Guitar Hero 2 Hack",IDC_GH2_HACK,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,336,259,76,10 GROUPBOX "Debugging",IDC_STATIC,216,285,79,25 CONTROL "Enable logging",IDC_DEBUG_FILE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,223,296,63,10 - PUSHBUTTON "Save",ID_SAVE,369,295,48,15 PUSHBUTTON "Load",ID_LOAD,313,295,48,15 + PUSHBUTTON "Save",ID_SAVE,369,295,48,15 END IDD_ABOUT DIALOGEX 0, 0, 108, 66 @@ -302,7 +303,7 @@ END // #ifdef APSTUDIO_INVOKED -GUIDELINES DESIGNINFO +GUIDELINES DESIGNINFO BEGIN IDD_CONFIG, DIALOG BEGIN