/[pcsx2_0.9.7]/branch/debug/0.X/0.9.X/0.9.7/ramdump-lateset/plugins/PadNull/Windows/PadWin.cpp
ViewVC logotype

Contents of /branch/debug/0.X/0.9.X/0.9.7/ramdump-lateset/plugins/PadNull/Windows/PadWin.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 415 - (show annotations) (download)
Sun Feb 27 08:25:06 2011 UTC (8 years, 11 months ago) by william
File size: 2036 byte(s)
fix issues from upstream merge of r4239-r4370
1 /* PadNull
2 * Copyright (C) 2004-2010 PCSX2 Dev Team
3 *
4 * PCSX2 is free software: you can redistribute it and/or modify it under the terms
5 * of the GNU Lesser General Public License as published by the Free Software Found-
6 * ation, either version 3 of the License, or (at your option) any later version.
7 *
8 * PCSX2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
9 * without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10 * PURPOSE. See the GNU General Public License for more details.
11 *
12 * You should have received a copy of the GNU General Public License along with PCSX2.
13 * If not, see <http://www.gnu.org/licenses/>.
14 */
15
16 #include "PadWin.h"
17
18 LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);
19 WNDPROC GSwndProc = NULL;
20 HWND GShwnd = NULL;
21
22 LRESULT WINAPI PADwndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
23 {
24 switch (msg)
25 {
26 case WM_KEYDOWN:
27 if (lParam & 0x40000000)return TRUE;
28
29 event.evt = KEYPRESS;
30 event.key = wParam;
31 break;
32
33 case WM_KEYUP:
34 event.evt = KEYRELEASE;
35 event.key = wParam;
36 break;
37
38 case WM_DESTROY:
39 case WM_QUIT:
40 event.evt = KEYPRESS;
41 event.key = VK_ESCAPE;
42 return GSwndProc(hWnd, msg, wParam, lParam);
43
44 default:
45 return GSwndProc(hWnd, msg, wParam, lParam);
46 };
47
48 return TRUE;
49 }
50
51 void _PadUpdate(int pad)
52 {
53 }
54
55 s32 _PADOpen(void *pDsp)
56 {
57 GShwnd = (HWND)*(long*)pDsp;
58
59 if (GShwnd != NULL && GSwndProc != NULL)
60 {
61 // revert
62 SetWindowLongPtr(GShwnd, GWLP_WNDPROC, (LPARAM)(WNDPROC)(GSwndProc));
63 }
64
65 GSwndProc = (WNDPROC)GetWindowLongPtr(GShwnd, GWLP_WNDPROC);
66 GSwndProc = ((WNDPROC)SetWindowLongPtr(GShwnd, GWLP_WNDPROC, (LPARAM)(WNDPROC)(PADwndProc)));
67 return 0;
68 }
69
70 void _PADClose()
71 {
72 if (GShwnd != NULL && GSwndProc != NULL)
73 {
74 SetWindowLongPtr(GShwnd, GWLP_WNDPROC, (LPARAM)(WNDPROC)(GSwndProc));
75 GSwndProc = NULL;
76 GShwnd = NULL;
77 }
78 }

  ViewVC Help
Powered by ViewVC 1.1.22