ReactOS  0.4.14-dev-49-gfb4591c
keyboard.c
Go to the documentation of this file.
1 /* DirectInput Keyboard device
2  *
3  * Copyright 1998 Marcus Meissner
4  * Copyright 1998,1999 Lionel Ulmer
5  * Copyright 2000-2001 TransGaming Technologies Inc.
6  * Copyright 2005 Raphael Junqueira
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21  */
22 
23 #include "config.h"
24 #include "wine/port.h"
25 
26 #include <stdarg.h>
27 #include <string.h>
28 #include "windef.h"
29 #include "winbase.h"
30 #include "winuser.h"
31 #include "winerror.h"
32 #include "dinput.h"
33 
34 #include "dinput_private.h"
35 #include "device_private.h"
36 #include "wine/debug.h"
37 #include "wine/unicode.h"
38 
40 
41 #define WINE_DINPUT_KEYBOARD_MAX_KEYS 256
42 
43 static const IDirectInputDevice8AVtbl SysKeyboardAvt;
44 static const IDirectInputDevice8WVtbl SysKeyboardWvt;
45 
48 {
52 };
53 
54 static inline SysKeyboardImpl *impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
55 {
57 }
58 static inline SysKeyboardImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
59 {
61 }
62 static inline IDirectInputDevice8A *IDirectInputDevice8A_from_impl(SysKeyboardImpl *This)
63 {
64  return &This->base.IDirectInputDevice8A_iface;
65 }
66 static inline IDirectInputDevice8W *IDirectInputDevice8W_from_impl(SysKeyboardImpl *This)
67 {
68  return &This->base.IDirectInputDevice8W_iface;
69 }
70 
71 static BYTE map_dik_code(DWORD scanCode, DWORD vkCode, DWORD subType)
72 {
73  if (!scanCode)
74  scanCode = MapVirtualKeyW(vkCode, MAPVK_VK_TO_VSC);
75 
76  if (subType == DIDEVTYPEKEYBOARD_JAPAN106)
77  {
78  switch (scanCode)
79  {
80  case 0x0d: /* ^ */
81  scanCode = DIK_CIRCUMFLEX;
82  break;
83  case 0x1a: /* @ */
84  scanCode = DIK_AT;
85  break;
86  case 0x1b: /* [ */
87  scanCode = DIK_LBRACKET;
88  break;
89  case 0x28: /* : */
90  scanCode = DIK_COLON;
91  break;
92  case 0x29: /* Hankaku/Zenkaku */
93  scanCode = DIK_KANJI;
94  break;
95  case 0x2b: /* ] */
96  scanCode = DIK_RBRACKET;
97  break;
98  case 0x73: /* \ */
99  scanCode = DIK_BACKSLASH;
100  break;
101  }
102  }
103  return scanCode;
104 }
105 
107 {
109  int dik_code, ret = This->base.dwCoopLevel & DISCL_EXCLUSIVE;
111  BYTE new_diks;
112 
113  if (wparam != WM_KEYDOWN && wparam != WM_KEYUP &&
115  return 0;
116 
117  TRACE("(%p) wp %08lx, lp %08lx, vk %02x, scan %02x\n",
118  iface, wparam, lparam, hook->vkCode, hook->scanCode);
119 
120  switch (hook->vkCode)
121  {
122  /* R-Shift is special - it is an extended key with separate scan code */
123  case VK_RSHIFT : dik_code = DIK_RSHIFT; break;
124  case VK_PAUSE : dik_code = DIK_PAUSE; break;
125  case VK_NUMLOCK : dik_code = DIK_NUMLOCK; break;
126  case VK_SUBTRACT: dik_code = DIK_SUBTRACT; break;
127  default:
128  dik_code = map_dik_code(hook->scanCode & 0xff, hook->vkCode, This->subtype);
129  if (hook->flags & LLKHF_EXTENDED) dik_code |= 0x80;
130  }
131  new_diks = hook->flags & LLKHF_UP ? 0 : 0x80;
132 
133  /* returns now if key event already known */
134  if (new_diks == This->DInputKeyState[dik_code])
135  return ret;
136 
137  This->DInputKeyState[dik_code] = new_diks;
138  TRACE(" setting %02X to %02X\n", dik_code, This->DInputKeyState[dik_code]);
139 
140  EnterCriticalSection(&This->base.crit);
142  new_diks, GetCurrentTime(), This->base.dinput->evsequence++);
143  LeaveCriticalSection(&This->base.crit);
144 
145  return ret;
146 }
147 
149 {
150  DWORD kbd_type, kbd_subtype, dev_subtype;
151  kbd_type = GetKeyboardType(0);
152  kbd_subtype = GetKeyboardType(1);
153 
154  if (kbd_type == 4 || (kbd_type == 7 && kbd_subtype == 0))
155  dev_subtype = DIDEVTYPEKEYBOARD_PCENH;
156  else if (kbd_type == 7 && kbd_subtype == 2)
157  dev_subtype = DIDEVTYPEKEYBOARD_JAPAN106;
158  else {
159  FIXME("Unknown keyboard type=%u, subtype=%u\n", kbd_type, kbd_subtype);
160  dev_subtype = DIDEVTYPEKEYBOARD_PCENH;
161  }
162  return dev_subtype;
163 }
164 
166  DWORD dwSize;
167  DIDEVICEINSTANCEA ddi;
168 
169  dwSize = lpddi->dwSize;
170 
171  TRACE("%d %p\n", dwSize, lpddi);
172 
173  memset(lpddi, 0, dwSize);
174  memset(&ddi, 0, sizeof(ddi));
175 
176  ddi.dwSize = dwSize;
177  ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
178  ddi.guidProduct = GUID_SysKeyboard;
179  if (version >= 0x0800)
180  ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8);
181  else
182  ddi.dwDevType = DIDEVTYPE_KEYBOARD | (subtype << 8);
183  strcpy(ddi.tszInstanceName, "Keyboard");
184  strcpy(ddi.tszProductName, "Wine Keyboard");
185 
186  memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi)));
187 }
188 
190  DWORD dwSize;
191  DIDEVICEINSTANCEW ddi;
192 
193  dwSize = lpddi->dwSize;
194 
195  TRACE("%d %p\n", dwSize, lpddi);
196 
197  memset(lpddi, 0, dwSize);
198  memset(&ddi, 0, sizeof(ddi));
199 
200  ddi.dwSize = dwSize;
201  ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
202  ddi.guidProduct = GUID_SysKeyboard;
203  if (version >= 0x0800)
204  ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8);
205  else
206  ddi.dwDevType = DIDEVTYPE_KEYBOARD | (subtype << 8);
207  MultiByteToWideChar(CP_ACP, 0, "Keyboard", -1, ddi.tszInstanceName, MAX_PATH);
208  MultiByteToWideChar(CP_ACP, 0, "Wine Keyboard", -1, ddi.tszProductName, MAX_PATH);
209 
210  memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi)));
211 }
212 
214 {
215  if (id != 0)
216  return E_FAIL;
217 
218  if ((dwDevType == 0) ||
219  ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 0x0800)) ||
220  (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 0x0800))) {
221  TRACE("Enumerating the Keyboard device\n");
222 
224 
225  return S_OK;
226  }
227 
228  return S_FALSE;
229 }
230 
232 {
233  if (id != 0)
234  return E_FAIL;
235 
236  if ((dwDevType == 0) ||
237  ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 0x0800)) ||
238  (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 0x0800))) {
239  TRACE("Enumerating the Keyboard device\n");
240 
242 
243  return S_OK;
244  }
245 
246  return S_FALSE;
247 }
248 
250 {
251  SysKeyboardImpl* newDevice;
252  LPDIDATAFORMAT df = NULL;
253  int i, idx = 0;
254 
256  newDevice->base.IDirectInputDevice8A_iface.lpVtbl = &SysKeyboardAvt;
257  newDevice->base.IDirectInputDevice8W_iface.lpVtbl = &SysKeyboardWvt;
258  newDevice->base.ref = 1;
259  memcpy(&newDevice->base.guid, rguid, sizeof(*rguid));
260  newDevice->base.dinput = dinput;
261  newDevice->base.event_proc = KeyboardCallback;
262  InitializeCriticalSection(&newDevice->base.crit);
263  newDevice->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SysKeyboardImpl*->base.crit");
264  newDevice->subtype = get_keyboard_subtype();
265 
266  /* Create copy of default data format */
267  if (!(df = HeapAlloc(GetProcessHeap(), 0, c_dfDIKeyboard.dwSize))) goto failed;
269  if (!(df->rgodf = HeapAlloc(GetProcessHeap(), 0, df->dwNumObjs * df->dwObjSize))) goto failed;
270 
271  for (i = 0; i < df->dwNumObjs; i++)
272  {
273  char buf[MAX_PATH];
274  BYTE dik_code;
275 
276  if (!GetKeyNameTextA(((i & 0x7f) << 16) | ((i & 0x80) << 17), buf, sizeof(buf)))
277  continue;
278 
279  dik_code = map_dik_code(i, 0, newDevice->subtype);
280  memcpy(&df->rgodf[idx], &c_dfDIKeyboard.rgodf[dik_code], df->dwObjSize);
281  df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON;
282  }
283  df->dwNumObjs = idx;
284 
285  newDevice->base.data_format.wine_df = df;
286  IDirectInput_AddRef(&newDevice->base.dinput->IDirectInput7A_iface);
287 
289  list_add_tail(&dinput->devices_list, &newDevice->base.entry);
291 
292  return newDevice;
293 
294 failed:
295  if (df) HeapFree(GetProcessHeap(), 0, df->rgodf);
296  HeapFree(GetProcessHeap(), 0, df);
297  HeapFree(GetProcessHeap(), 0, newDevice);
298  return NULL;
299 }
300 
301 
303 {
304  TRACE("%p %s %s %p %i\n", dinput, debugstr_guid(rguid), debugstr_guid(riid), pdev, unicode);
305  *pdev = NULL;
306 
307  if (IsEqualGUID(&GUID_SysKeyboard, rguid)) /* Wine Keyboard */
308  {
310 
311  if (riid == NULL)
312  ;/* nothing */
313  else if (IsEqualGUID(&IID_IDirectInputDeviceA, riid) ||
314  IsEqualGUID(&IID_IDirectInputDevice2A, riid) ||
315  IsEqualGUID(&IID_IDirectInputDevice7A, riid) ||
316  IsEqualGUID(&IID_IDirectInputDevice8A, riid))
317  {
318  unicode = 0;
319  }
320  else if (IsEqualGUID(&IID_IDirectInputDeviceW, riid) ||
321  IsEqualGUID(&IID_IDirectInputDevice2W, riid) ||
322  IsEqualGUID(&IID_IDirectInputDevice7W, riid) ||
323  IsEqualGUID(&IID_IDirectInputDevice8W, riid))
324  {
325  unicode = 1;
326  }
327  else
328  {
329  WARN("no interface\n");
330  return DIERR_NOINTERFACE;
331  }
332 
333  This = alloc_device(rguid, dinput);
334  TRACE("Created a Keyboard device (%p)\n", This);
335 
336  if (!This) return DIERR_OUTOFMEMORY;
337 
338  if (unicode)
339  *pdev = &This->base.IDirectInputDevice8W_iface;
340  else
341  *pdev = &This->base.IDirectInputDevice8A_iface;
342 
343  return DI_OK;
344  }
345 
346  return DIERR_DEVICENOTREG;
347 }
348 
350  "Wine keyboard driver",
354 };
355 
357 {
359  TRACE("(%p)->(%d,%p)\n", This, len, ptr);
360 
361  if (!This->base.acquired) return DIERR_NOTACQUIRED;
362 
363  if (len != This->base.data_format.user_df->dwDataSize )
364  return DIERR_INVALIDPARAM;
365 
367 
368  EnterCriticalSection(&This->base.crit);
369 
370  if (TRACE_ON(dinput)) {
371  int i;
372  for (i = 0; i < WINE_DINPUT_KEYBOARD_MAX_KEYS; i++) {
373  if (This->DInputKeyState[i] != 0x00)
374  TRACE(" - %02X: %02x\n", i, This->DInputKeyState[i]);
375  }
376  }
377 
378  fill_DataFormat(ptr, len, This->DInputKeyState, &This->base.data_format);
379  LeaveCriticalSection(&This->base.crit);
380 
381  return DI_OK;
382 }
383 
385 {
388 }
389 
390 /******************************************************************************
391  * GetCapabilities : get the device capabilities
392  */
394 {
396  DIDEVCAPS devcaps;
397 
398  TRACE("(this=%p,%p)\n",This,lpDIDevCaps);
399 
400  if ((lpDIDevCaps->dwSize != sizeof(DIDEVCAPS)) && (lpDIDevCaps->dwSize != sizeof(DIDEVCAPS_DX3))) {
401  WARN("invalid parameter\n");
402  return DIERR_INVALIDPARAM;
403  }
404 
405  devcaps.dwSize = lpDIDevCaps->dwSize;
406  devcaps.dwFlags = DIDC_ATTACHED | DIDC_EMULATED;
407  if (This->base.dinput->dwVersion >= 0x0800)
408  devcaps.dwDevType = DI8DEVTYPE_KEYBOARD | (This->subtype << 8);
409  else
410  devcaps.dwDevType = DIDEVTYPE_KEYBOARD | (This->subtype << 8);
411  devcaps.dwAxes = 0;
412  devcaps.dwButtons = This->base.data_format.wine_df->dwNumObjs;
413  devcaps.dwPOVs = 0;
414  devcaps.dwFFSamplePeriod = 0;
415  devcaps.dwFFMinTimeResolution = 0;
416  devcaps.dwFirmwareRevision = 100;
417  devcaps.dwHardwareRevision = 100;
418  devcaps.dwFFDriverVersion = 0;
419 
420  memcpy(lpDIDevCaps, &devcaps, lpDIDevCaps->dwSize);
421 
422  return DI_OK;
423 }
424 
426 {
429 }
430 
431 static DWORD map_dik_to_scan(DWORD dik_code, DWORD subtype)
432 {
433  if (dik_code == DIK_PAUSE || dik_code == DIK_NUMLOCK) dik_code ^= 0x80;
434  if (subtype == DIDEVTYPEKEYBOARD_JAPAN106)
435  {
436  switch (dik_code)
437  {
438  case DIK_CIRCUMFLEX:
439  dik_code = 0x0d;
440  break;
441  case DIK_AT:
442  dik_code = 0x1a;
443  break;
444  case DIK_LBRACKET:
445  dik_code = 0x1b;
446  break;
447  case DIK_COLON:
448  dik_code = 0x28;
449  break;
450  case DIK_KANJI:
451  dik_code = 0x29;
452  break;
453  case DIK_RBRACKET:
454  dik_code = 0x2b;
455  break;
456  case DIK_BACKSLASH:
457  dik_code = 0x73;
458  break;
459  }
460  }
461 
462  return dik_code;
463 }
464 
465 /******************************************************************************
466  * GetObjectInfo : get information about a device object such as a button
467  * or axis
468  */
469 static HRESULT WINAPI
471  LPDIRECTINPUTDEVICE8A iface,
473  DWORD dwObj,
474  DWORD dwHow)
475 {
477  HRESULT res;
478  LONG scan;
479 
480  res = IDirectInputDevice2AImpl_GetObjectInfo(iface, pdidoi, dwObj, dwHow);
481  if (res != DI_OK) return res;
482 
483  scan = map_dik_to_scan(DIDFT_GETINSTANCE(pdidoi->dwType), This->subtype);
484  if (!GetKeyNameTextA((scan & 0x80) << 17 | (scan & 0x7f) << 16,
485  pdidoi->tszName, sizeof(pdidoi->tszName)))
486  return DIERR_OBJECTNOTFOUND;
487 
488  _dump_OBJECTINSTANCEA(pdidoi);
489  return res;
490 }
491 
494  DWORD dwObj,
495  DWORD dwHow)
496 {
498  HRESULT res;
499  LONG scan;
500 
501  res = IDirectInputDevice2WImpl_GetObjectInfo(iface, pdidoi, dwObj, dwHow);
502  if (res != DI_OK) return res;
503 
504  scan = map_dik_to_scan(DIDFT_GETINSTANCE(pdidoi->dwType), This->subtype);
505  if (!GetKeyNameTextW((scan & 0x80) << 17 | (scan & 0x7f) << 16,
506  pdidoi->tszName, ARRAY_SIZE(pdidoi->tszName)))
507  return DIERR_OBJECTNOTFOUND;
508 
509  _dump_OBJECTINSTANCEW(pdidoi);
510  return res;
511 }
512 
513 /******************************************************************************
514  * GetDeviceInfo : get information about a device's identity
515  */
517  LPDIRECTINPUTDEVICE8A iface,
518  LPDIDEVICEINSTANCEA pdidi)
519 {
521  TRACE("(this=%p,%p)\n", This, pdidi);
522 
523  if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA)) {
524  WARN(" dinput3 not supported yet...\n");
525  return DI_OK;
526  }
527 
528  fill_keyboard_dideviceinstanceA(pdidi, This->base.dinput->dwVersion, This->subtype);
529 
530  return DI_OK;
531 }
532 
534 {
536  TRACE("(this=%p,%p)\n", This, pdidi);
537 
538  if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEW)) {
539  WARN(" dinput3 not supported yet...\n");
540  return DI_OK;
541  }
542 
543  fill_keyboard_dideviceinstanceW(pdidi, This->base.dinput->dwVersion, This->subtype);
544 
545  return DI_OK;
546 }
547 
548 /******************************************************************************
549  * GetProperty : Retrieves information about the input device.
550  */
552  REFGUID rguid, LPDIPROPHEADER pdiph)
553 {
555 
556  TRACE("(%p) %s,%p\n", iface, debugstr_guid(rguid), pdiph);
557  _dump_DIPROPHEADER(pdiph);
558 
559  if (!IS_DIPROP(rguid)) return DI_OK;
560 
561  switch (LOWORD(rguid))
562  {
564  {
565  HRESULT hr;
566  LPDIPROPSTRING ps = (LPDIPROPSTRING)pdiph;
568 
569  if (pdiph->dwSize != sizeof(DIPROPSTRING))
570  return DIERR_INVALIDPARAM;
571 
572  didoi.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW);
573 
574  hr = SysKeyboardWImpl_GetObjectInfo(iface, &didoi, ps->diph.dwObj, ps->diph.dwHow);
575  if (hr == DI_OK)
576  memcpy(ps->wsz, didoi.tszName, sizeof(ps->wsz));
577  return hr;
578  }
579  case (DWORD_PTR) DIPROP_RANGE:
580  return DIERR_UNSUPPORTED;
581  default:
583  }
584  return DI_OK;
585 }
586 
588  REFGUID rguid, LPDIPROPHEADER pdiph)
589 {
592 }
593 
595 {
597  HRESULT res;
598 
599  TRACE("(%p)\n", This);
600 
602  if (res == DI_OK)
603  {
604  TRACE("clearing keystate\n");
605  memset(This->DInputKeyState, 0, sizeof(This->DInputKeyState));
606  }
607 
608  return res;
609 }
610 
612 {
615 }
616 
618  LPDIACTIONFORMATW lpdiaf,
619  LPCWSTR lpszUserName,
620  DWORD dwFlags)
621 {
622  FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
623 
624  return _build_action_map(iface, lpdiaf, lpszUserName, dwFlags, DIKEYBOARD_MASK, &c_dfDIKeyboard);
625 }
626 
628  LPDIACTIONFORMATA lpdiaf,
629  LPCSTR lpszUserName,
630  DWORD dwFlags)
631 {
633  DIACTIONFORMATW diafW;
634  HRESULT hr;
635  WCHAR *lpszUserNameW = NULL;
636  int username_size;
637 
638  diafW.rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*lpdiaf->dwNumActions);
639  _copy_diactionformatAtoW(&diafW, lpdiaf);
640 
641  if (lpszUserName != NULL)
642  {
643  username_size = MultiByteToWideChar(CP_ACP, 0, lpszUserName, -1, NULL, 0);
644  lpszUserNameW = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*username_size);
645  MultiByteToWideChar(CP_ACP, 0, lpszUserName, -1, lpszUserNameW, username_size);
646  }
647 
648  hr = SysKeyboardWImpl_BuildActionMap(&This->base.IDirectInputDevice8W_iface, &diafW, lpszUserNameW, dwFlags);
649 
650  _copy_diactionformatWtoA(lpdiaf, &diafW);
651  HeapFree(GetProcessHeap(), 0, diafW.rgoAction);
652  HeapFree(GetProcessHeap(), 0, lpszUserNameW);
653 
654  return hr;
655 }
656 
658  LPDIACTIONFORMATW lpdiaf,
659  LPCWSTR lpszUserName,
660  DWORD dwFlags)
661 {
662  FIXME("(%p)->(%p,%s,%08x): semi-stub !\n", iface, lpdiaf, debugstr_w(lpszUserName), dwFlags);
663 
664  return _set_action_map(iface, lpdiaf, lpszUserName, dwFlags, &c_dfDIKeyboard);
665 }
666 
668  LPDIACTIONFORMATA lpdiaf,
669  LPCSTR lpszUserName,
670  DWORD dwFlags)
671 {
673  DIACTIONFORMATW diafW;
674  HRESULT hr;
675  WCHAR *lpszUserNameW = NULL;
676  int username_size;
677 
678  diafW.rgoAction = HeapAlloc(GetProcessHeap(), 0, sizeof(DIACTIONW)*lpdiaf->dwNumActions);
679  _copy_diactionformatAtoW(&diafW, lpdiaf);
680 
681  if (lpszUserName != NULL)
682  {
683  username_size = MultiByteToWideChar(CP_ACP, 0, lpszUserName, -1, NULL, 0);
684  lpszUserNameW = HeapAlloc(GetProcessHeap(), 0, sizeof(WCHAR)*username_size);
685  MultiByteToWideChar(CP_ACP, 0, lpszUserName, -1, lpszUserNameW, username_size);
686  }
687 
688  hr = SysKeyboardWImpl_SetActionMap(&This->base.IDirectInputDevice8W_iface, &diafW, lpszUserNameW, dwFlags);
689 
690  HeapFree(GetProcessHeap(), 0, diafW.rgoAction);
691  HeapFree(GetProcessHeap(), 0, lpszUserNameW);
692 
693  return hr;
694 }
695 
696 static const IDirectInputDevice8AVtbl SysKeyboardAvt =
697 {
730 };
731 
732 static const IDirectInputDevice8WVtbl SysKeyboardWvt =
733 {
766 };
#define VK_SUBTRACT
Definition: winuser.h:2227
HRESULT WINAPI IDirectInputDevice2AImpl_SetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPCDIPROPHEADER pdiph)
Definition: device.c:1442
HRESULT WINAPI IDirectInputDevice8WImpl_GetImageInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEIMAGEINFOHEADERW lpdiDevImageInfoHeader)
Definition: device.c:1841
HRESULT WINAPI IDirectInputDevice2WImpl_EnumObjects(LPDIRECTINPUTDEVICE8W iface, LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback, LPVOID lpvRef, DWORD dwFlags)
Definition: device.c:1257
HRESULT WINAPI IDirectInputDevice2WImpl_CreateEffect(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdef, LPUNKNOWN pUnkOuter)
Definition: device.c:1628
GUID guidInstance
Definition: dinput.h:413
#define IDirectInput_AddRef(p)
Definition: dinput.h:2240
static HRESULT WINAPI SysKeyboardAImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8A iface, LPDIDEVICEINSTANCEA pdidi)
Definition: keyboard.c:516
HRESULT WINAPI IDirectInputDevice2AImpl_GetDeviceData(LPDIRECTINPUTDEVICE8A iface, DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags)
Definition: device.c:1590
void check_dinput_events(void)
Definition: dinput_main.c:1870
HRESULT WINAPI IDirectInputDevice2AImpl_Poll(LPDIRECTINPUTDEVICE8A iface)
Definition: device.c:1749
struct DIPROPSTRING * LPDIPROPSTRING
#define REFIID
Definition: guiddef.h:118
HRESULT WINAPI IDirectInputDevice2AImpl_SendDeviceData(LPDIRECTINPUTDEVICE8A iface, DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags)
Definition: device.c:1764
DWORD dwFFMinTimeResolution
Definition: dinput.h:941
DWORD dwSize
Definition: dinput.h:828
DWORD dwDevType
Definition: dinput.h:428
#define DIK_AT
Definition: dinput.h:564
#define DIK_RSHIFT
Definition: dinput.h:523
HRESULT WINAPI IDirectInputDevice2WImpl_SendForceFeedbackCommand(LPDIRECTINPUTDEVICE8W iface, DWORD dwFlags)
Definition: device.c:1701
static void fill_keyboard_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD version, DWORD subtype)
Definition: keyboard.c:165
static DWORD get_keyboard_subtype(void)
Definition: keyboard.c:148
#define WINE_DINPUT_KEYBOARD_MAX_KEYS
Definition: keyboard.c:41
WINE_DEFAULT_DEBUG_CHANNEL(dinput)
#define DIDC_EMULATED
Definition: dinput.h:949
void _dump_OBJECTINSTANCEA(const DIDEVICEOBJECTINSTANCEA *ddoi)
Definition: device.c:185
DWORD dwSize
Definition: dinput.h:808
#define DWORD_PTR
Definition: treelist.c:76
HRESULT hr
Definition: shlfolder.c:183
Definition: scsiwmi.h:51
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
HRESULT WINAPI IDirectInputDevice2AImpl_EnumObjects(LPDIRECTINPUTDEVICE8A iface, LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback, LPVOID lpvRef, DWORD dwFlags)
Definition: device.c:1227
#define DIDFT_PSHBUTTON
Definition: dinput.h:754
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
#define DIERR_NOTACQUIRED
Definition: dinput.h:167
REFIID riid
Definition: precomp.h:44
HRESULT _set_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, LPCDIDATAFORMAT df)
Definition: device.c:824
#define CP_ACP
Definition: compat.h:99
DWORD dwNumObjs
Definition: dinput.h:812
HRESULT WINAPI IDirectInputDevice2WImpl_Acquire(LPDIRECTINPUTDEVICE8W iface)
Definition: device.c:983
static IDirectInputDevice8W * IDirectInputDevice8W_from_impl(SysKeyboardImpl *This)
Definition: keyboard.c:66
void _dump_OBJECTINSTANCEW(const DIDEVICEOBJECTINSTANCEW *ddoi)
Definition: device.c:190
#define WARN(fmt,...)
Definition: debug.h:111
#define DIK_NUMLOCK
Definition: dinput.h:538
#define DIK_BACKSLASH
Definition: dinput.h:512
static HRESULT WINAPI SysKeyboardWImpl_GetProperty(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPDIPROPHEADER pdiph)
Definition: keyboard.c:551
#define DIDFT_MAKEINSTANCE(n)
Definition: dinput.h:762
IDirectInputDevice8A IDirectInputDevice8A_iface
#define DIDC_ATTACHED
Definition: dinput.h:947
DWORD dwNumActions
Definition: dinput.h:1313
DWORD dwObjSize
Definition: dinput.h:809
HRESULT WINAPI IDirectInputDevice2AImpl_RunControlPanel(LPDIRECTINPUTDEVICE8A iface, HWND hwndOwner, DWORD dwFlags)
Definition: device.c:1604
WCHAR tszName[MAX_PATH]
Definition: dinput.h:371
struct list devices_list
UINT_PTR WPARAM
Definition: windef.h:207
#define DIPROP_RANGE
Definition: dinput.h:892
static int KeyboardCallback(LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM lparam)
Definition: keyboard.c:106
HRESULT WINAPI IDirectInputDevice2WImpl_Poll(LPDIRECTINPUTDEVICE8W iface)
Definition: device.c:1739
void WINAPI EnterCriticalSection(LPCRITICAL_SECTION)
HRESULT WINAPI IDirectInputDevice7WImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8W iface, LPCWSTR lpszFileName, DWORD dwEntries, LPDIFILEEFFECT rgDiFileEft, DWORD dwFlags)
Definition: device.c:1806
DWORD dwHow
Definition: dinput.h:831
#define DI8DEVTYPE_KEYBOARD
Definition: dinput.h:211
#define E_FAIL
Definition: ddrawi.h:102
ULONG WINAPI IDirectInputDevice2WImpl_AddRef(LPDIRECTINPUTDEVICE8W iface)
Definition: device.c:1215
#define DIDFT_GETINSTANCE(n)
Definition: dinput.h:764
#define DIK_CIRCUMFLEX
Definition: dinput.h:563
DWORD dwDevType
Definition: dinput.h:936
#define DIERR_UNSUPPORTED
Definition: dinput.h:156
HRESULT WINAPI IDirectInputDevice2AImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPDIPROPHEADER pdiph)
Definition: device.c:1345
static HRESULT WINAPI SysKeyboardWImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow)
Definition: keyboard.c:492
IDirectInputImpl * dinput
static HRESULT WINAPI SysKeyboardWImpl_SetActionMap(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags)
Definition: keyboard.c:657
__WINE_SERVER_LIST_INLINE void list_add_tail(struct list *list, struct list *elem)
Definition: list.h:102
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define GetCurrentTime
Definition: winbase.h:2049
DWORD dwFFSamplePeriod
Definition: dinput.h:940
static SysKeyboardImpl * impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
Definition: keyboard.c:54
struct IDirectInputDeviceImpl base
Definition: keyboard.c:49
long LONG
Definition: pedump.c:60
HRESULT WINAPI IDirectInputDevice2WImpl_SendDeviceData(LPDIRECTINPUTDEVICE8W iface, DWORD cbObjectData, LPCDIDEVICEOBJECTDATA rgdod, LPDWORD pdwInOut, DWORD dwFlags)
Definition: device.c:1755
static UINT WPARAM LPARAM lparam
Definition: combo.c:716
const struct dinput_device keyboard_device
Definition: keyboard.c:349
#define debugstr_w
Definition: kernel32.h:32
#define FIXME(fmt,...)
Definition: debug.h:110
DWORD dwDevType
Definition: dinput.h:415
static PVOID ptr
Definition: dispmode.c:27
struct DIDEVICEOBJECTINSTANCEW DIDEVICEOBJECTINSTANCEW
unsigned int idx
Definition: utils.c:41
#define S_FALSE
Definition: winerror.h:2357
#define LLKHF_UP
Definition: winuser.h:2623
DWORD dwFlags
Definition: dinput.h:935
GUID guidProduct
Definition: dinput.h:414
VOID WINAPI InitializeCriticalSection(OUT LPCRITICAL_SECTION lpCriticalSection)
Definition: synch.c:751
smooth NULL
Definition: ftsmooth.c:416
static const WCHAR version[]
Definition: asmname.c:64
#define DIK_COLON
Definition: dinput.h:565
int WINAPI GetKeyNameTextA(_In_ LONG lParam, _Out_writes_(cchSize) LPSTR lpString, _In_ int cchSize)
DWORD dwAxes
Definition: dinput.h:937
#define WM_KEYDOWN
Definition: winuser.h:1697
LONG_PTR LPARAM
Definition: windef.h:208
HRESULT WINAPI IDirectInputDevice2AImpl_Escape(LPDIRECTINPUTDEVICE8A iface, LPDIEFFESCAPE lpDIEEsc)
Definition: device.c:1733
static HRESULT WINAPI SysKeyboardAImpl_BuildActionMap(LPDIRECTINPUTDEVICE8A iface, LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags)
Definition: keyboard.c:627
DWORD dwPOVs
Definition: dinput.h:939
UINT WINAPI MapVirtualKeyW(_In_ UINT, _In_ UINT)
#define DIDEVTYPEKEYBOARD_PCENH
Definition: dinput.h:232
#define DIK_KANJI
Definition: dinput.h:567
const char * LPCSTR
Definition: xmlstorage.h:183
#define debugstr_guid
Definition: kernel32.h:35
DWORD dwHardwareRevision
Definition: dinput.h:943
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
HRESULT WINAPI IDirectInputDevice2AImpl_EnumCreatedEffectObjects(LPDIRECTINPUTDEVICE8A iface, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID lpvRef, DWORD dwFlags)
Definition: device.c:1720
static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState(LPDIRECTINPUTDEVICE8A iface, DWORD len, LPVOID ptr)
Definition: keyboard.c:384
#define DIK_LBRACKET
Definition: dinput.h:495
#define DIERR_INVALIDPARAM
Definition: dinput.h:152
HRESULT WINAPI IDirectInputDevice7AImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8A iface, LPCSTR lpszFileName, LPDIENUMEFFECTSINFILECALLBACK pec, LPVOID pvRef, DWORD dwFlags)
Definition: device.c:1773
static HRESULT WINAPI SysKeyboardWImpl_GetDeviceState(LPDIRECTINPUTDEVICE8W iface, DWORD len, LPVOID ptr)
Definition: keyboard.c:356
HRESULT WINAPI IDirectInputDevice8AImpl_GetImageInfo(LPDIRECTINPUTDEVICE8A iface, LPDIDEVICEIMAGEINFOHEADERA lpdiDevImageInfoHeader)
Definition: device.c:1833
static SysKeyboardImpl * alloc_device(REFGUID rguid, IDirectInputImpl *dinput)
Definition: keyboard.c:249
Definition: msg.h:42
#define TRACE(s)
Definition: solgame.cpp:4
HRESULT WINAPI IDirectInputDevice2WImpl_SetEventNotification(LPDIRECTINPUTDEVICE8W iface, HANDLE event)
Definition: device.c:1119
HRESULT WINAPI IDirectInputDevice2WImpl_RunControlPanel(LPDIRECTINPUTDEVICE8W iface, HWND hwndOwner, DWORD dwFlags)
Definition: device.c:1597
void _dump_DIPROPHEADER(LPCDIPROPHEADER diph)
Definition: device.c:175
static HRESULT WINAPI SysKeyboardAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPDIPROPHEADER pdiph)
Definition: keyboard.c:587
static HRESULT WINAPI SysKeyboardAImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8A iface, LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow)
Definition: keyboard.c:470
#define GetProcessHeap()
Definition: compat.h:395
HRESULT WINAPI IDirectInputDevice7AImpl_WriteEffectToFile(LPDIRECTINPUTDEVICE8A iface, LPCSTR lpszFileName, DWORD dwEntries, LPDIFILEEFFECT rgDiFileEft, DWORD dwFlags)
Definition: device.c:1795
DWORD dwSize
Definition: dinput.h:934
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
HRESULT WINAPI IDirectInputDevice2WImpl_SetDataFormat(LPDIRECTINPUTDEVICE8W iface, LPCDIDATAFORMAT df)
Definition: device.c:1042
static HRESULT WINAPI SysKeyboardWImpl_BuildActionMap(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags)
Definition: keyboard.c:617
#define DIERR_OUTOFMEMORY
Definition: dinput.h:155
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define MAPVK_VK_TO_VSC
Definition: winuser.h:2330
LONG HRESULT
Definition: typedefs.h:77
#define DIK_PAUSE
Definition: dinput.h:577
void fill_DataFormat(void *out, DWORD size, const void *in, const DataFormat *df)
Definition: device.c:325
DWORD dwFFDriverVersion
Definition: dinput.h:944
HRESULT WINAPI IDirectInputDevice2AImpl_EnumEffects(LPDIRECTINPUTDEVICE8A iface, LPDIENUMEFFECTSCALLBACKA lpCallback, LPVOID lpvRef, DWORD dwFlags)
Definition: device.c:1645
static HRESULT WINAPI SysKeyboardWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi)
Definition: keyboard.c:533
DWORD dwButtons
Definition: dinput.h:938
#define MAX_PATH
Definition: compat.h:26
#define WINAPI
Definition: msvc.h:8
HRESULT WINAPI IDirectInputDevice2WImpl_EnumEffects(LPDIRECTINPUTDEVICE8W iface, LPDIENUMEFFECTSCALLBACKW lpCallback, LPVOID lpvRef, DWORD dwFlags)
Definition: device.c:1657
#define WM_KEYUP
Definition: winuser.h:1698
static HRESULT WINAPI SysKeyboardWImpl_GetCapabilities(LPDIRECTINPUTDEVICE8W iface, LPDIDEVCAPS lpDIDevCaps)
Definition: keyboard.c:393
#define DIERR_DEVICENOTREG
Definition: dinput.h:147
unsigned long DWORD
Definition: ntddk_ex.h:95
WCHAR wsz[MAX_PATH]
Definition: dinput.h:875
HRESULT WINAPI IDirectInputDevice2WImpl_Initialize(LPDIRECTINPUTDEVICE8W iface, HINSTANCE hinst, DWORD dwVersion, REFGUID rguid)
Definition: device.c:1610
HRESULT WINAPI IDirectInputDevice2AImpl_SendForceFeedbackCommand(LPDIRECTINPUTDEVICE8A iface, DWORD dwFlags)
Definition: device.c:1707
static HRESULT WINAPI SysKeyboardAImpl_SetActionMap(LPDIRECTINPUTDEVICE8A iface, LPDIACTIONFORMATA lpdiaf, LPCSTR lpszUserName, DWORD dwFlags)
Definition: keyboard.c:667
HRESULT WINAPI IDirectInputDevice2WImpl_GetDeviceData(LPDIRECTINPUTDEVICE8W iface, DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags)
Definition: device.c:1534
CHAR tszName[MAX_PATH]
Definition: dinput.h:352
HRESULT WINAPI IDirectInputDevice2WImpl_Escape(LPDIRECTINPUTDEVICE8W iface, LPDIEFFESCAPE lpDIEEsc)
Definition: device.c:1727
HRESULT WINAPI IDirectInputDevice2AImpl_GetEffectInfo(LPDIRECTINPUTDEVICE8A iface, LPDIEFFECTINFOA lpdei, REFGUID rguid)
Definition: device.c:1669
WCHAR tszProductName[MAX_PATH]
Definition: dinput.h:430
#define DI8DEVCLASS_KEYBOARD
Definition: dinput.h:206
#define DIDEVTYPE_KEYBOARD
Definition: dinput.h:199
int ret
HRESULT WINAPI IDirectInputDevice2WImpl_QueryInterface(LPDIRECTINPUTDEVICE8W iface, REFIID riid, LPVOID *ppobj)
Definition: device.c:1180
HRESULT WINAPI IDirectInputDevice2AImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface)
Definition: device.c:1032
ULONG WINAPI IDirectInputDevice2AImpl_Release(LPDIRECTINPUTDEVICE8A iface)
Definition: device.c:1174
#define VK_RSHIFT
Definition: winuser.h:2258
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1175
static DWORD map_dik_to_scan(DWORD dik_code, DWORD subtype)
Definition: keyboard.c:431
static BYTE map_dik_code(DWORD scanCode, DWORD vkCode, DWORD subType)
Definition: keyboard.c:71
#define LLKHF_EXTENDED
Definition: winuser.h:2620
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
unsigned char BYTE
Definition: mem.h:68
CHAR tszInstanceName[MAX_PATH]
Definition: dinput.h:416
LPDIOBJECTDATAFORMAT rgodf
Definition: dinput.h:813
DWORD subtype
Definition: keyboard.c:51
#define DIKEYBOARD_MASK
HRESULT WINAPI IDirectInputDevice2AImpl_QueryInterface(LPDIRECTINPUTDEVICE8A iface, REFIID riid, LPVOID *ppobj)
Definition: device.c:1209
uint32_t DWORD_PTR
Definition: typedefs.h:63
WCHAR tszInstanceName[MAX_PATH]
Definition: dinput.h:429
LPDIACTIONW rgoAction
Definition: dinput.h:1332
HRESULT WINAPI IDirectInputDevice2WImpl_GetEffectInfo(LPDIRECTINPUTDEVICE8W iface, LPDIEFFECTINFOW lpdei, REFGUID rguid)
Definition: device.c:1679
#define DIK_RBRACKET
Definition: dinput.h:496
int WINAPI GetKeyNameTextW(_In_ LONG lParam, _Out_writes_(cchSize) LPWSTR lpString, _In_ int cchSize)
#define S_OK
Definition: intsafe.h:59
HRESULT WINAPI IDirectInputDevice2AImpl_SetCooperativeLevel(LPDIRECTINPUTDEVICE8A iface, HWND hwnd, DWORD dwflags)
Definition: device.c:1110
static void fill_keyboard_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD version, DWORD subtype)
Definition: keyboard.c:189
CRITICAL_SECTION crit
struct IDirectInputDevice8W * LPDIRECTINPUTDEVICE8W
Definition: dinput.h:106
void _copy_diactionformatAtoW(LPDIACTIONFORMATW to, LPDIACTIONFORMATA from)
Definition: dinput_main.c:323
HRESULT WINAPI IDirectInputDevice2AImpl_GetForceFeedbackState(LPDIRECTINPUTDEVICE8A iface, LPDWORD pdwOut)
Definition: device.c:1695
#define VK_NUMLOCK
Definition: winuser.h:2254
#define DIERR_NOINTERFACE
Definition: dinput.h:153
HRESULT WINAPI IDirectInputDevice2WImpl_SetCooperativeLevel(LPDIRECTINPUTDEVICE8W iface, HWND hwnd, DWORD dwflags)
Definition: device.c:1074
HRESULT WINAPI IDirectInputDevice7WImpl_EnumEffectsInFile(LPDIRECTINPUTDEVICE8W iface, LPCWSTR lpszFileName, LPDIENUMEFFECTSINFILECALLBACK pec, LPVOID pvRef, DWORD dwFlags)
Definition: device.c:1784
#define ARRAY_SIZE(a)
Definition: main.h:24
#define WM_SYSKEYUP
Definition: winuser.h:1702
ULONG WINAPI IDirectInputDevice2AImpl_AddRef(LPDIRECTINPUTDEVICE8A iface)
Definition: device.c:1221
static const IDirectInputDevice8WVtbl SysKeyboardWvt
Definition: keyboard.c:44
HRESULT WINAPI IDirectInputDevice2WImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEOBJECTINSTANCEW pdidoi, DWORD dwObj, DWORD dwHow)
Definition: device.c:1481
void _copy_diactionformatWtoA(LPDIACTIONFORMATA to, LPDIACTIONFORMATW from)
Definition: dinput_main.c:350
DWORD dwObj
Definition: dinput.h:830
#define DIDEVTYPEKEYBOARD_JAPAN106
Definition: dinput.h:238
BOOL WINAPI IsEqualGUID(REFGUID rguid1, REFGUID rguid2)
Definition: compobj.c:4021
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
GUID guidInstance
Definition: dinput.h:426
HRESULT WINAPI IDirectInputDevice2AImpl_SetDataFormat(LPDIRECTINPUTDEVICE8A iface, LPCDIDATAFORMAT df)
Definition: device.c:1063
const DIDATAFORMAT c_dfDIKeyboard
Definition: data_formats.c:561
#define MultiByteToWideChar
Definition: compat.h:100
HRESULT WINAPI IDirectInputDevice2AImpl_CreateEffect(LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPCDIEFFECT lpeff, LPDIRECTINPUTEFFECT *ppdef, LPUNKNOWN pUnkOuter)
Definition: device.c:1638
static HRESULT WINAPI SysKeyboardAImpl_GetCapabilities(LPDIRECTINPUTDEVICE8A iface, LPDIDEVCAPS lpDIDevCaps)
Definition: keyboard.c:425
CHAR tszProductName[MAX_PATH]
Definition: dinput.h:417
void queue_event(LPDIRECTINPUTDEVICE8A iface, int inst_id, DWORD data, DWORD time, DWORD seq)
Definition: device.c:932
HRESULT _build_action_map(LPDIRECTINPUTDEVICE8W iface, LPDIACTIONFORMATW lpdiaf, LPCWSTR lpszUserName, DWORD dwFlags, DWORD devMask, LPCDIDATAFORMAT df)
Definition: device.c:762
struct IDirectInputDevice8A * LPDIRECTINPUTDEVICE8A
Definition: dinput.h:105
HRESULT WINAPI IDirectInputDevice2WImpl_EnumCreatedEffectObjects(LPDIRECTINPUTDEVICE8W iface, LPDIENUMCREATEDEFFECTOBJECTSCALLBACK lpCallback, LPVOID lpvRef, DWORD dwFlags)
Definition: device.c:1713
#define VK_PAUSE
Definition: winuser.h:2180
static HRESULT WINAPI SysKeyboardWImpl_Acquire(LPDIRECTINPUTDEVICE8W iface)
Definition: keyboard.c:594
static SysKeyboardImpl * impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
Definition: keyboard.c:58
GLuint res
Definition: glext.h:9613
#define DI_OK
Definition: dinput.h:128
#define WM_SYSKEYDOWN
Definition: winuser.h:1701
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
static HRESULT keyboarddev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, DWORD version, int id)
Definition: keyboard.c:231
IDirectInputDevice8W IDirectInputDevice8W_iface
DWORD dwFirmwareRevision
Definition: dinput.h:942
HRESULT WINAPI IDirectInputDevice2WImpl_Unacquire(LPDIRECTINPUTDEVICE8W iface)
Definition: device.c:1015
BYTE DInputKeyState[WINE_DINPUT_KEYBOARD_MAX_KEYS]
Definition: keyboard.c:50
HRESULT WINAPI IDirectInputDevice2AImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8A iface, LPDIDEVICEOBJECTINSTANCEA pdidoi, DWORD dwObj, DWORD dwHow)
Definition: device.c:1449
HRESULT WINAPI IDirectInputDevice2WImpl_SetProperty(LPDIRECTINPUTDEVICE8W iface, REFGUID rguid, LPCDIPROPHEADER pdiph)
Definition: device.c:1355
#define IS_DIPROP(x)
static IDirectInputDevice8A * IDirectInputDevice8A_from_impl(SysKeyboardImpl *This)
Definition: keyboard.c:62
void WINAPI LeaveCriticalSection(LPCRITICAL_SECTION)
#define DIK_SUBTRACT
Definition: dinput.h:543
static HRESULT keyboarddev_create_device(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPVOID *pdev, int unicode)
Definition: keyboard.c:302
#define memset(x, y, z)
Definition: compat.h:39
#define TRACE_ON(x)
Definition: compat.h:65
DIPROPHEADER diph
Definition: dinput.h:874
#define LOWORD(l)
Definition: pedump.c:82
static HRESULT WINAPI SysKeyboardAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
Definition: keyboard.c:611
static HRESULT keyboarddev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id)
Definition: keyboard.c:213
#define HeapFree(x, y, z)
Definition: compat.h:394
HRESULT WINAPI IDirectInputDevice2AImpl_SetEventNotification(LPDIRECTINPUTDEVICE8A iface, HANDLE event)
Definition: device.c:1131
#define DIERR_OBJECTNOTFOUND
Definition: dinput.h:150
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
#define DIPROP_KEYNAME
Definition: dinput.h:916
#define DISCL_EXCLUSIVE
Definition: dinput.h:965
HRESULT WINAPI IDirectInputDevice2WImpl_GetForceFeedbackState(LPDIRECTINPUTDEVICE8W iface, LPDWORD pdwOut)
Definition: device.c:1689
int WINAPI GetKeyboardType(_In_ int)
static UINT WPARAM wparam
Definition: combo.c:716
static const IDirectInputDevice8AVtbl SysKeyboardAvt
Definition: keyboard.c:43
ULONG WINAPI IDirectInputDevice2WImpl_Release(LPDIRECTINPUTDEVICE8W iface)
Definition: device.c:1138
GUID guidProduct
Definition: dinput.h:427
HRESULT WINAPI IDirectInputDevice2AImpl_Initialize(LPDIRECTINPUTDEVICE8A iface, HINSTANCE hinst, DWORD dwVersion, REFGUID rguid)
Definition: device.c:1617