1 /* DirectInput Keyboard device
3 * Copyright 1998 Marcus Meissner
4 * Copyright 1998,1999 Lionel Ulmer
5 * Copyright 2000-2001 TransGaming Technologies Inc.
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 #include "wine/port.h"
33 #include "dinput_private.h"
34 #include "device_private.h"
35 #include "wine/debug.h"
36 #include "wine/unicode.h"
38 WINE_DEFAULT_DEBUG_CHANNEL(dinput);
40 static ICOM_VTABLE(IDirectInputDevice8A) SysKeyboardAvt;
41 static ICOM_VTABLE(IDirectInputDevice8W) SysKeyboardWvt;
43 typedef struct SysKeyboardImpl SysKeyboardImpl;
44 struct SysKeyboardImpl
50 IDirectInputImpl* dinput;
53 /* SysKeyboardAImpl */
55 int buffersize; /* set in 'SetProperty' */
56 LPDIDEVICEOBJECTDATA buffer; /* buffer for 'GetDeviceData'.
57 Alloc at 'Acquire', Free at
59 int count; /* number of objects in use in
61 int start; /* 'buffer' rotates. This is the
62 first in use (if count > 0) */
63 BOOL overflow; /* return DI_BUFFEROVERFLOW in
65 CRITICAL_SECTION crit;
68 SysKeyboardImpl *current; /* Today's acquired device
69 FIXME: currently this can be only one.
70 Maybe this should be a linked list or st.
71 I don't know what the rules are for multiple acquired keyboards,
72 but 'DI_LOSTFOCUS' and 'DI_UNACQUIRED' exist for a reason.
75 static BYTE DInputKeyState[256]; /* array for 'GetDeviceState' */
77 static CRITICAL_SECTION keyboard_crit;
78 static CRITICAL_SECTION_DEBUG critsect_debug =
81 { &critsect_debug.ProcessLocksList, &critsect_debug.ProcessLocksList },
82 0, 0, { 0, (DWORD)(__FILE__ ": keyboard_crit") }
84 static CRITICAL_SECTION keyboard_crit = { &critsect_debug, -1, 0, 0, 0, 0 };
86 static DWORD keyboard_users;
87 static HHOOK keyboard_hook;
89 LRESULT CALLBACK KeyboardCallback( int code, WPARAM wparam, LPARAM lparam )
91 TRACE("(%d,%d,%ld)\n", code, wparam, lparam);
93 if (code == HC_ACTION)
100 KBDLLHOOKSTRUCT *hook = (KBDLLHOOKSTRUCT *)lparam;
101 dik_code = hook->scanCode;
102 if (hook->flags & LLKHF_EXTENDED) dik_code |= 0x80;
103 down = !(hook->flags & LLKHF_UP);
104 timestamp = hook->time;
107 DInputKeyState[dik_code] = (down ? 0x80 : 0);
108 TRACE(" setting %02X to %02X\n", dik_code, DInputKeyState[dik_code]);
113 SetEvent(current->hEvent);
115 if (current->buffer != NULL)
119 EnterCriticalSection(&(current->crit));
121 n = (current->start + current->count) % current->buffersize;
123 current->buffer[n].dwOfs = dik_code;
124 current->buffer[n].dwData = down ? 0x80 : 0;
125 current->buffer[n].dwTimeStamp = timestamp;
126 current->buffer[n].dwSequence = current->dinput->evsequence++;
128 TRACE("Adding event at offset %d : %ld - %ld - %ld - %ld\n", n,
129 current->buffer[n].dwOfs, current->buffer[n].dwData, current->buffer[n].dwTimeStamp, current->buffer[n].dwSequence);
131 if (current->count == current->buffersize)
133 current->start = ++current->start % current->buffersize;
134 current->overflow = TRUE;
139 LeaveCriticalSection(&(current->crit));
144 return CallNextHookEx(keyboard_hook, code, wparam, lparam);
147 static GUID DInput_Wine_Keyboard_GUID = { /* 0ab8648a-7735-11d2-8c73-71df54a96441 */
151 {0x8c, 0x73, 0x71, 0xdf, 0x54, 0xa9, 0x64, 0x41}
154 static void fill_keyboard_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, int version) {
156 DIDEVICEINSTANCEA ddi;
158 dwSize = lpddi->dwSize;
160 TRACE("%ld %p\n", dwSize, lpddi);
162 memset(lpddi, 0, dwSize);
163 memset(&ddi, 0, sizeof(ddi));
166 ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
167 ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */
169 ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8);
171 ddi.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
172 strcpy(ddi.tszInstanceName, "Keyboard");
173 strcpy(ddi.tszProductName, "Wine Keyboard");
175 memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi)));
178 static void fill_keyboard_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, int version) {
180 DIDEVICEINSTANCEW ddi;
182 dwSize = lpddi->dwSize;
184 TRACE("%ld %p\n", dwSize, lpddi);
186 memset(lpddi, 0, dwSize);
187 memset(&ddi, 0, sizeof(ddi));
190 ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
191 ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */
193 ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8);
195 ddi.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
196 MultiByteToWideChar(CP_ACP, 0, "Keyboard", -1, ddi.tszInstanceName, MAX_PATH);
197 MultiByteToWideChar(CP_ACP, 0, "Wine Keyboard", -1, ddi.tszProductName, MAX_PATH);
199 memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi)));
202 static BOOL keyboarddev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, int version)
204 if ((dwDevType == 0) ||
205 ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 8)) ||
206 ((dwDevType == DI8DEVTYPE_KEYBOARD) && (version >= 8))) {
207 TRACE("Enumerating the Keyboard device\n");
209 fill_keyboard_dideviceinstanceA(lpddi, version);
217 static BOOL keyboarddev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, int version)
219 if ((dwDevType == 0) ||
220 ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 8)) ||
221 ((dwDevType == DI8DEVTYPE_KEYBOARD) && (version >= 8))) {
222 TRACE("Enumerating the Keyboard device\n");
224 fill_keyboard_dideviceinstanceW(lpddi, version);
232 static SysKeyboardImpl *alloc_device(REFGUID rguid, LPVOID kvt, IDirectInputImpl *dinput)
234 SysKeyboardImpl* newDevice;
235 newDevice = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(SysKeyboardImpl));
236 newDevice->lpVtbl = kvt;
238 memcpy(&(newDevice->guid),rguid,sizeof(*rguid));
239 newDevice->dinput = dinput;
241 EnterCriticalSection(&keyboard_crit);
242 if (!keyboard_users++)
243 keyboard_hook = SetWindowsHookExW( WH_KEYBOARD_LL, KeyboardCallback, DINPUT_instance, 0 );
244 LeaveCriticalSection(&keyboard_crit);
250 static HRESULT keyboarddev_create_deviceA(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEA* pdev)
252 if ((IsEqualGUID(&GUID_SysKeyboard,rguid)) || /* Generic Keyboard */
253 (IsEqualGUID(&DInput_Wine_Keyboard_GUID,rguid))) { /* Wine Keyboard */
254 if ((riid == NULL) ||
255 IsEqualGUID(&IID_IDirectInputDeviceA,riid) ||
256 IsEqualGUID(&IID_IDirectInputDevice2A,riid) ||
257 IsEqualGUID(&IID_IDirectInputDevice7A,riid) ||
258 IsEqualGUID(&IID_IDirectInputDevice8A,riid)) {
259 *pdev = (IDirectInputDeviceA*) alloc_device(rguid, &SysKeyboardAvt, dinput);
260 TRACE("Creating a Keyboard device (%p)\n", *pdev);
263 return DIERR_NOINTERFACE;
265 return DIERR_DEVICENOTREG;
268 static HRESULT keyboarddev_create_deviceW(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEW* pdev)
270 if ((IsEqualGUID(&GUID_SysKeyboard,rguid)) || /* Generic Keyboard */
271 (IsEqualGUID(&DInput_Wine_Keyboard_GUID,rguid))) { /* Wine Keyboard */
272 if ((riid == NULL) ||
273 IsEqualGUID(&IID_IDirectInputDeviceW,riid) ||
274 IsEqualGUID(&IID_IDirectInputDevice2W,riid) ||
275 IsEqualGUID(&IID_IDirectInputDevice7W,riid) ||
276 IsEqualGUID(&IID_IDirectInputDevice8W,riid)) {
277 *pdev = (IDirectInputDeviceW*) alloc_device(rguid, &SysKeyboardWvt, dinput);
278 TRACE("Creating a Keyboard device (%p)\n", *pdev);
281 return DIERR_NOINTERFACE;
283 return DIERR_DEVICENOTREG;
286 static dinput_device keyboarddev = {
288 keyboarddev_enum_deviceA,
289 keyboarddev_enum_deviceW,
290 keyboarddev_create_deviceA,
291 keyboarddev_create_deviceW
294 DECL_GLOBAL_CONSTRUCTOR(keyboarddev_register) { dinput_register_device(&keyboarddev); }
296 static ULONG WINAPI SysKeyboardAImpl_Release(LPDIRECTINPUTDEVICE8A iface)
298 ICOM_THIS(SysKeyboardImpl,iface);
304 EnterCriticalSection(&keyboard_crit);
305 if (!--keyboard_users) {
306 UnhookWindowsHookEx( keyboard_hook );
309 LeaveCriticalSection(&keyboard_crit);
311 /* Free the data queue */
312 if (This->buffer != NULL)
313 HeapFree(GetProcessHeap(),0,This->buffer);
315 DeleteCriticalSection(&(This->crit));
317 HeapFree(GetProcessHeap(),0,This);
321 static HRESULT WINAPI SysKeyboardAImpl_SetProperty(
322 LPDIRECTINPUTDEVICE8A iface,REFGUID rguid,LPCDIPROPHEADER ph
325 ICOM_THIS(SysKeyboardImpl,iface);
327 TRACE("(this=%p,%s,%p)\n",This,debugstr_guid(rguid),ph);
328 TRACE("(size=%ld,headersize=%ld,obj=%ld,how=%ld\n",
329 ph->dwSize,ph->dwHeaderSize,ph->dwObj,ph->dwHow);
330 if (!HIWORD(rguid)) {
331 switch ((DWORD)rguid) {
332 case (DWORD) DIPROP_BUFFERSIZE: {
333 LPCDIPROPDWORD pd = (LPCDIPROPDWORD)ph;
335 TRACE("(buffersize=%ld)\n",pd->dwData);
338 return DIERR_INVALIDPARAM;
340 This->buffersize = pd->dwData;
345 WARN("Unknown type %ld\n",(DWORD)rguid);
352 static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState(
353 LPDIRECTINPUTDEVICE8A iface,DWORD len,LPVOID ptr
356 TRACE("(%p)->(%ld,%p)\n", iface, len, ptr);
358 /* Note: device does not need to be acquired */
360 return DIERR_INVALIDPARAM;
362 MsgWaitForMultipleObjectsEx(0, NULL, 0, 0, 0);
364 if (TRACE_ON(dinput)) {
366 for (i = 0; i < 256; i++) {
367 if (DInputKeyState[i] != 0x00) {
368 TRACE(" - %02X: %02x\n", i, DInputKeyState[i]);
373 memcpy(ptr, DInputKeyState, 256);
377 static HRESULT WINAPI SysKeyboardAImpl_GetDeviceData(
378 LPDIRECTINPUTDEVICE8A iface,DWORD dodsize,LPDIDEVICEOBJECTDATA dod,
379 LPDWORD entries,DWORD flags
382 ICOM_THIS(SysKeyboardImpl,iface);
383 int ret = DI_OK, i = 0;
385 TRACE("(this=%p,%ld,%p,%p(%ld)),0x%08lx)\n",
386 This,dodsize,dod,entries,entries?*entries:0,flags);
388 if (This->acquired == 0)
389 return DIERR_NOTACQUIRED;
391 if (This->buffer == NULL)
392 return DIERR_NOTBUFFERED;
394 if (dodsize < sizeof(*dod))
395 return DIERR_INVALIDPARAM;
397 MsgWaitForMultipleObjectsEx(0, NULL, 0, 0, 0);
399 EnterCriticalSection(&(This->crit));
401 /* Copy item at a time for the case dodsize > sizeof(buffer[n]) */
402 while ((i < *entries || *entries == INFINITE) && i < This->count)
406 int n = (This->start + i) % This->buffersize;
407 LPDIDEVICEOBJECTDATA pd
408 = (LPDIDEVICEOBJECTDATA)((BYTE *)dod + dodsize * i);
409 pd->dwOfs = This->buffer[n].dwOfs;
410 pd->dwData = This->buffer[n].dwData;
411 pd->dwTimeStamp = This->buffer[n].dwTimeStamp;
412 pd->dwSequence = This->buffer[n].dwSequence;
420 ret = DI_BUFFEROVERFLOW;
422 if (!(flags & DIGDD_PEEK))
426 This->start = (This->start + i) % This->buffersize;
427 This->overflow = FALSE;
430 LeaveCriticalSection(&(This->crit));
432 TRACE("Returning %ld events queued\n", *entries);
437 static HRESULT WINAPI SysKeyboardAImpl_EnumObjects(
438 LPDIRECTINPUTDEVICE8A iface,
439 LPDIENUMDEVICEOBJECTSCALLBACKA lpCallback,
443 ICOM_THIS(SysKeyboardImpl,iface);
444 DIDEVICEOBJECTINSTANCEA ddoi;
447 TRACE("(this=%p,%p,%p,%08lx)\n", This, lpCallback, lpvRef, dwFlags);
448 if (TRACE_ON(dinput)) {
449 TRACE(" - flags = ");
450 _dump_EnumObjects_flags(dwFlags);
454 /* Only the fields till dwFFMaxForce are relevant */
455 memset(&ddoi, 0, sizeof(ddoi));
456 ddoi.dwSize = FIELD_OFFSET(DIDEVICEOBJECTINSTANCEA, dwFFMaxForce);
458 for (i = 0; i < 256; i++) {
459 /* Report 255 keys :-) */
460 ddoi.guidType = GUID_Key;
462 ddoi.dwType = DIDFT_MAKEINSTANCE(i) | DIDFT_BUTTON;
463 GetKeyNameTextA(((i & 0x7f) << 16) | ((i & 0x80) << 17), ddoi.tszName, sizeof(ddoi.tszName));
464 _dump_OBJECTINSTANCEA(&ddoi);
465 if (lpCallback(&ddoi, lpvRef) != DIENUM_CONTINUE) return DI_OK;
471 static HRESULT WINAPI SysKeyboardWImpl_EnumObjects(LPDIRECTINPUTDEVICE8W iface,
472 LPDIENUMDEVICEOBJECTSCALLBACKW lpCallback,
476 ICOM_THIS(SysKeyboardImpl,iface);
478 device_enumobjects_AtoWcb_data data;
480 data.lpCallBack = lpCallback;
481 data.lpvRef = lpvRef;
483 return SysKeyboardAImpl_EnumObjects((LPDIRECTINPUTDEVICE8A) This, (LPDIENUMDEVICEOBJECTSCALLBACKA) DIEnumDevicesCallbackAtoW, (LPVOID) &data, dwFlags);
486 static HRESULT WINAPI SysKeyboardAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface);
488 static HRESULT WINAPI SysKeyboardAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
490 ICOM_THIS(SysKeyboardImpl,iface);
492 TRACE("(this=%p)\n",This);
501 FIXME("Not more than one keyboard can be acquired at the same time.\n");
502 SysKeyboardAImpl_Unacquire(iface);
507 if (This->buffersize > 0)
509 This->buffer = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY,
510 This->buffersize * sizeof(*(This->buffer)));
513 This->overflow = FALSE;
514 InitializeCriticalSection(&(This->crit));
522 static HRESULT WINAPI SysKeyboardAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface)
524 ICOM_THIS(SysKeyboardImpl,iface);
525 TRACE("(this=%p)\n",This);
527 if (This->acquired == 0)
533 ERR("this != current\n");
537 if (This->buffersize >= 0)
539 HeapFree(GetProcessHeap(), 0, This->buffer);
541 DeleteCriticalSection(&(This->crit));
547 static HRESULT WINAPI SysKeyboardAImpl_SetEventNotification(LPDIRECTINPUTDEVICE8A iface,
549 ICOM_THIS(SysKeyboardImpl,iface);
551 TRACE("(this=%p,0x%08lx)\n",This,(DWORD)hnd);
557 /******************************************************************************
558 * GetCapabilities : get the device capablitites
560 static HRESULT WINAPI SysKeyboardAImpl_GetCapabilities(
561 LPDIRECTINPUTDEVICE8A iface,
562 LPDIDEVCAPS lpDIDevCaps)
564 ICOM_THIS(SysKeyboardImpl,iface);
566 TRACE("(this=%p,%p)\n",This,lpDIDevCaps);
568 if (lpDIDevCaps->dwSize == sizeof(DIDEVCAPS)) {
569 lpDIDevCaps->dwFlags = DIDC_ATTACHED;
570 if (This->dinput->version >= 8)
571 lpDIDevCaps->dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8);
573 lpDIDevCaps->dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
574 lpDIDevCaps->dwAxes = 0;
575 lpDIDevCaps->dwButtons = 256;
576 lpDIDevCaps->dwPOVs = 0;
577 lpDIDevCaps->dwFFSamplePeriod = 0;
578 lpDIDevCaps->dwFFMinTimeResolution = 0;
579 lpDIDevCaps->dwFirmwareRevision = 100;
580 lpDIDevCaps->dwHardwareRevision = 100;
581 lpDIDevCaps->dwFFDriverVersion = 0;
584 FIXME("DirectX 3.0 not supported....\n");
590 /******************************************************************************
591 * GetObjectInfo : get information about a device object such as a button
594 static HRESULT WINAPI
595 SysKeyboardAImpl_GetObjectInfo(
596 LPDIRECTINPUTDEVICE8A iface,
597 LPDIDEVICEOBJECTINSTANCEA pdidoi,
601 ICOM_THIS(SysKeyboardImpl,iface);
602 DIDEVICEOBJECTINSTANCEA ddoi;
603 DWORD dwSize = pdidoi->dwSize;
605 TRACE("(this=%p,%p,%ld,0x%08lx)\n", This, pdidoi, dwObj, dwHow);
607 if (dwHow == DIPH_BYID) {
608 WARN(" querying by id not supported yet...\n");
612 memset(pdidoi, 0, dwSize);
613 memset(&ddoi, 0, sizeof(ddoi));
615 ddoi.dwSize = dwSize;
616 ddoi.guidType = GUID_Key;
618 ddoi.dwType = DIDFT_MAKEINSTANCE(dwObj) | DIDFT_BUTTON;
619 GetKeyNameTextA(((dwObj & 0x7f) << 16) | ((dwObj & 0x80) << 17), ddoi.tszName, sizeof(ddoi.tszName));
621 /* And return our just filled device object instance structure */
622 memcpy(pdidoi, &ddoi, (dwSize < sizeof(ddoi) ? dwSize : sizeof(ddoi)));
624 _dump_OBJECTINSTANCEA(pdidoi);
629 static HRESULT WINAPI SysKeyboardWImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface,
630 LPDIDEVICEOBJECTINSTANCEW pdidoi,
634 ICOM_THIS(SysKeyboardImpl,iface);
635 DIDEVICEOBJECTINSTANCEW ddoi;
636 DWORD dwSize = pdidoi->dwSize;
638 TRACE("(this=%p,%p,%ld,0x%08lx)\n", This, pdidoi, dwObj, dwHow);
640 if (dwHow == DIPH_BYID) {
641 WARN(" querying by id not supported yet...\n");
645 memset(pdidoi, 0, dwSize);
646 memset(&ddoi, 0, sizeof(ddoi));
648 ddoi.dwSize = dwSize;
649 ddoi.guidType = GUID_Key;
651 ddoi.dwType = DIDFT_MAKEINSTANCE(dwObj) | DIDFT_BUTTON;
652 GetKeyNameTextW(((dwObj & 0x7f) << 16) | ((dwObj & 0x80) << 17), ddoi.tszName, sizeof(ddoi.tszName));
654 /* And return our just filled device object instance structure */
655 memcpy(pdidoi, &ddoi, (dwSize < sizeof(ddoi) ? dwSize : sizeof(ddoi)));
657 _dump_OBJECTINSTANCEW(pdidoi);
662 /******************************************************************************
663 * GetDeviceInfo : get information about a device's identity
665 static HRESULT WINAPI SysKeyboardAImpl_GetDeviceInfo(
666 LPDIRECTINPUTDEVICE8A iface,
667 LPDIDEVICEINSTANCEA pdidi)
669 ICOM_THIS(SysKeyboardImpl,iface);
670 TRACE("(this=%p,%p)\n", This, pdidi);
672 if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA)) {
673 WARN(" dinput3 not supporte yet...\n");
677 fill_keyboard_dideviceinstanceA(pdidi, This->dinput->version);
682 static HRESULT WINAPI SysKeyboardWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi)
684 ICOM_THIS(SysKeyboardImpl,iface);
685 TRACE("(this=%p,%p)\n", This, pdidi);
687 if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEW)) {
688 WARN(" dinput3 not supporte yet...\n");
692 fill_keyboard_dideviceinstanceW(pdidi, This->dinput->version);
697 static ICOM_VTABLE(IDirectInputDevice8A) SysKeyboardAvt =
699 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
700 IDirectInputDevice2AImpl_QueryInterface,
701 IDirectInputDevice2AImpl_AddRef,
702 SysKeyboardAImpl_Release,
703 SysKeyboardAImpl_GetCapabilities,
704 SysKeyboardAImpl_EnumObjects,
705 IDirectInputDevice2AImpl_GetProperty,
706 SysKeyboardAImpl_SetProperty,
707 SysKeyboardAImpl_Acquire,
708 SysKeyboardAImpl_Unacquire,
709 SysKeyboardAImpl_GetDeviceState,
710 SysKeyboardAImpl_GetDeviceData,
711 IDirectInputDevice2AImpl_SetDataFormat,
712 SysKeyboardAImpl_SetEventNotification,
713 IDirectInputDevice2AImpl_SetCooperativeLevel,
714 SysKeyboardAImpl_GetObjectInfo,
715 SysKeyboardAImpl_GetDeviceInfo,
716 IDirectInputDevice2AImpl_RunControlPanel,
717 IDirectInputDevice2AImpl_Initialize,
718 IDirectInputDevice2AImpl_CreateEffect,
719 IDirectInputDevice2AImpl_EnumEffects,
720 IDirectInputDevice2AImpl_GetEffectInfo,
721 IDirectInputDevice2AImpl_GetForceFeedbackState,
722 IDirectInputDevice2AImpl_SendForceFeedbackCommand,
723 IDirectInputDevice2AImpl_EnumCreatedEffectObjects,
724 IDirectInputDevice2AImpl_Escape,
725 IDirectInputDevice2AImpl_Poll,
726 IDirectInputDevice2AImpl_SendDeviceData,
727 IDirectInputDevice7AImpl_EnumEffectsInFile,
728 IDirectInputDevice7AImpl_WriteEffectToFile,
729 IDirectInputDevice8AImpl_BuildActionMap,
730 IDirectInputDevice8AImpl_SetActionMap,
731 IDirectInputDevice8AImpl_GetImageInfo
734 #if !defined(__STRICT_ANSI__) && defined(__GNUC__)
735 # define XCAST(fun) (typeof(SysKeyboardWvt.fun))
737 # define XCAST(fun) (void*)
740 static ICOM_VTABLE(IDirectInputDevice8W) SysKeyboardWvt =
742 ICOM_MSVTABLE_COMPAT_DummyRTTIVALUE
743 IDirectInputDevice2WImpl_QueryInterface,
744 XCAST(AddRef)IDirectInputDevice2AImpl_AddRef,
745 XCAST(Release)SysKeyboardAImpl_Release,
746 XCAST(GetCapabilities)SysKeyboardAImpl_GetCapabilities,
747 SysKeyboardWImpl_EnumObjects,
748 XCAST(GetProperty)IDirectInputDevice2AImpl_GetProperty,
749 XCAST(SetProperty)SysKeyboardAImpl_SetProperty,
750 XCAST(Acquire)SysKeyboardAImpl_Acquire,
751 XCAST(Unacquire)SysKeyboardAImpl_Unacquire,
752 XCAST(GetDeviceState)SysKeyboardAImpl_GetDeviceState,
753 XCAST(GetDeviceData)SysKeyboardAImpl_GetDeviceData,
754 XCAST(SetDataFormat)IDirectInputDevice2AImpl_SetDataFormat,
755 XCAST(SetEventNotification)SysKeyboardAImpl_SetEventNotification,
756 XCAST(SetCooperativeLevel)IDirectInputDevice2AImpl_SetCooperativeLevel,
757 SysKeyboardWImpl_GetObjectInfo,
758 SysKeyboardWImpl_GetDeviceInfo,
759 XCAST(RunControlPanel)IDirectInputDevice2AImpl_RunControlPanel,
760 XCAST(Initialize)IDirectInputDevice2AImpl_Initialize,
761 XCAST(CreateEffect)IDirectInputDevice2AImpl_CreateEffect,
762 IDirectInputDevice2WImpl_EnumEffects,
763 IDirectInputDevice2WImpl_GetEffectInfo,
764 XCAST(GetForceFeedbackState)IDirectInputDevice2AImpl_GetForceFeedbackState,
765 XCAST(SendForceFeedbackCommand)IDirectInputDevice2AImpl_SendForceFeedbackCommand,
766 XCAST(EnumCreatedEffectObjects)IDirectInputDevice2AImpl_EnumCreatedEffectObjects,
767 XCAST(Escape)IDirectInputDevice2AImpl_Escape,
768 XCAST(Poll)IDirectInputDevice2AImpl_Poll,
769 XCAST(SendDeviceData)IDirectInputDevice2AImpl_SendDeviceData,
770 IDirectInputDevice7WImpl_EnumEffectsInFile,
771 IDirectInputDevice7WImpl_WriteEffectToFile,
772 IDirectInputDevice8WImpl_BuildActionMap,
773 IDirectInputDevice8WImpl_SetActionMap,
774 IDirectInputDevice8WImpl_GetImageInfo