~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

Wine Cross Reference
wine/dlls/dinput/keyboard.c

Version: ~ [ wine-1.1.33 ] ~ [ wine-1.1.32 ] ~ [ wine-1.1.31 ] ~ [ wine-1.1.30 ] ~ [ wine-1.1.29 ] ~ [ wine-1.1.28 ] ~ [ wine-1.1.27 ] ~ [ wine-1.1.26 ] ~ [ wine-1.1.25 ] ~ [ wine-1.1.24 ] ~ [ wine-1.1.23 ] ~ [ wine-1.1.22 ] ~ [ wine-1.1.21 ] ~ [ wine-1.1.20 ] ~ [ wine-1.1.19 ] ~ [ wine-1.1.18 ] ~ [ wine-1.1.17 ] ~ [ wine-1.1.16 ] ~ [ wine-1.1.15 ] ~ [ wine-1.1.14 ] ~ [ wine-1.1.13 ] ~ [ wine-1.1.12 ] ~ [ wine-1.1.11 ] ~ [ wine-1.1.10 ] ~ [ wine-1.1.9 ] ~ [ wine-1.1.8 ] ~ [ wine-1.1.7 ] ~ [ wine-1.0.1 ] ~ [ wine-1.1.6 ] ~ [ wine-1.1.5 ] ~ [ wine-1.1.4 ] ~ [ wine-1.1.3 ] ~ [ wine-1.1.2 ] ~ [ wine-1.1.1 ] ~ [ wine-1.1.0 ] ~ [ wine-1.0 ] ~

  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 
 39 WINE_DEFAULT_DEBUG_CHANNEL(dinput);
 40 
 41 #define WINE_DINPUT_KEYBOARD_MAX_KEYS 256
 42 
 43 static const IDirectInputDevice8AVtbl SysKeyboardAvt;
 44 static const IDirectInputDevice8WVtbl SysKeyboardWvt;
 45 
 46 typedef struct SysKeyboardImpl SysKeyboardImpl;
 47 struct SysKeyboardImpl
 48 {
 49     struct IDirectInputDevice2AImpl base;
 50     BYTE DInputKeyState[WINE_DINPUT_KEYBOARD_MAX_KEYS];
 51 };
 52 
 53 static BYTE map_dik_code(DWORD scanCode, DWORD vkCode)
 54 {
 55     static const BYTE asciiCodes[] =
 56      {/*32*/  DIK_SPACE,0,0,0,0,0,0,DIK_APOSTROPHE,
 57       /*40*/  0,0,0,0,DIK_COMMA,DIK_MINUS,DIK_PERIOD,DIK_SLASH,
 58       /*48*/  DIK_0,DIK_1,DIK_2,DIK_3,DIK_4,DIK_5,DIK_6,DIK_7,
 59       /*56*/  DIK_8,DIK_9,DIK_COLON,DIK_SEMICOLON,0,DIK_EQUALS,0,0,
 60       /*64*/  DIK_AT,DIK_A,DIK_B,DIK_C,DIK_D,DIK_E,DIK_F,DIK_G,
 61       /*72*/  DIK_H,DIK_I,DIK_J,DIK_K,DIK_L,DIK_M,DIK_N,DIK_O,
 62       /*80*/  DIK_P,DIK_Q,DIK_R,DIK_S,DIK_T,DIK_U,DIK_V,DIK_W,
 63       /*88*/  DIK_X,DIK_Y,DIK_Z,DIK_LBRACKET,0,DIK_RBRACKET,DIK_CIRCUMFLEX,DIK_UNDERLINE}      /*95*/ ;
 64 
 65     BYTE out_code = 0;
 66     WCHAR c = MapVirtualKeyW(vkCode,MAPVK_VK_TO_CHAR);
 67 
 68     if (c > 31 && c < 96)
 69         out_code = asciiCodes[c - 32];
 70 
 71     if (out_code == 0)
 72         out_code = scanCode;
 73 
 74     return out_code;
 75 }
 76 
 77 static int KeyboardCallback( LPDIRECTINPUTDEVICE8A iface, WPARAM wparam, LPARAM lparam )
 78 {
 79     SysKeyboardImpl *This = (SysKeyboardImpl *)iface;
 80     int dik_code, ret = This->base.dwCoopLevel & DISCL_EXCLUSIVE;
 81     KBDLLHOOKSTRUCT *hook = (KBDLLHOOKSTRUCT *)lparam;
 82     BYTE new_diks;
 83 
 84     if (wparam != WM_KEYDOWN && wparam != WM_KEYUP &&
 85         wparam != WM_SYSKEYDOWN && wparam != WM_SYSKEYUP)
 86         return 0;
 87 
 88     TRACE("(%p) %ld,%ld\n", iface, wparam, lparam);
 89 
 90     switch (hook->vkCode)
 91     {
 92         /* R-Shift is special - it is an extended key with separate scan code */
 93         case VK_RSHIFT  : dik_code = DIK_RSHIFT; break;
 94         case VK_PAUSE   : dik_code = DIK_PAUSE; break;
 95         case VK_NUMLOCK : dik_code = DIK_NUMLOCK; break;
 96         case VK_SUBTRACT: dik_code = DIK_SUBTRACT; break;
 97         default:
 98             dik_code = map_dik_code(hook->scanCode & 0xff, hook->vkCode);
 99             if (hook->flags & LLKHF_EXTENDED) dik_code |= 0x80;
100     }
101     new_diks = hook->flags & LLKHF_UP ? 0 : 0x80;
102 
103     /* returns now if key event already known */
104     if (new_diks == This->DInputKeyState[dik_code])
105         return ret;
106 
107     This->DInputKeyState[dik_code] = new_diks;
108     TRACE(" setting %02X to %02X\n", dik_code, This->DInputKeyState[dik_code]);
109 
110     dik_code = id_to_offset(&This->base.data_format, DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON);
111     EnterCriticalSection(&This->base.crit);
112     queue_event((LPDIRECTINPUTDEVICE8A)This, dik_code, new_diks, hook->time, This->base.dinput->evsequence++);
113     LeaveCriticalSection(&This->base.crit);
114 
115     return ret;
116 }
117 
118 const GUID DInput_Wine_Keyboard_GUID = { /* 0ab8648a-7735-11d2-8c73-71df54a96441 */
119     0x0ab8648a, 0x7735, 0x11d2, {0x8c, 0x73, 0x71, 0xdf, 0x54, 0xa9, 0x64, 0x41}
120 };
121 
122 static void fill_keyboard_dideviceinstanceA(LPDIDEVICEINSTANCEA lpddi, DWORD version) {
123     DWORD dwSize;
124     DIDEVICEINSTANCEA ddi;
125     
126     dwSize = lpddi->dwSize;
127 
128     TRACE("%d %p\n", dwSize, lpddi);
129     
130     memset(lpddi, 0, dwSize);
131     memset(&ddi, 0, sizeof(ddi));
132 
133     ddi.dwSize = dwSize;
134     ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
135     ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */
136     if (version >= 0x0800)
137         ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8);
138     else
139         ddi.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
140     strcpy(ddi.tszInstanceName, "Keyboard");
141     strcpy(ddi.tszProductName, "Wine Keyboard");
142 
143     memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi)));
144 }
145 
146 static void fill_keyboard_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD version) {
147     DWORD dwSize;
148     DIDEVICEINSTANCEW ddi;
149     
150     dwSize = lpddi->dwSize;
151 
152     TRACE("%d %p\n", dwSize, lpddi);
153     
154     memset(lpddi, 0, dwSize);
155     memset(&ddi, 0, sizeof(ddi));
156  
157     ddi.dwSize = dwSize;
158     ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
159     ddi.guidProduct = DInput_Wine_Keyboard_GUID; /* Vendor's GUID */
160     if (version >= 0x0800)
161         ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8);
162     else
163         ddi.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
164     MultiByteToWideChar(CP_ACP, 0, "Keyboard", -1, ddi.tszInstanceName, MAX_PATH);
165     MultiByteToWideChar(CP_ACP, 0, "Wine Keyboard", -1, ddi.tszProductName, MAX_PATH);
166 
167     memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi)));
168 }
169  
170 static BOOL keyboarddev_enum_deviceA(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEA lpddi, DWORD version, int id)
171 {
172   if (id != 0)
173     return FALSE;
174 
175   if ((dwDevType == 0) ||
176       ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 0x0800)) ||
177       (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 0x0800))) {
178     TRACE("Enumerating the Keyboard device\n");
179  
180     fill_keyboard_dideviceinstanceA(lpddi, version);
181     
182     return TRUE;
183   }
184 
185   return FALSE;
186 }
187 
188 static BOOL keyboarddev_enum_deviceW(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, DWORD version, int id)
189 {
190   if (id != 0)
191     return FALSE;
192 
193   if ((dwDevType == 0) ||
194       ((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 0x0800)) ||
195       (((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 0x0800))) {
196     TRACE("Enumerating the Keyboard device\n");
197 
198     fill_keyboard_dideviceinstanceW(lpddi, version);
199     
200     return TRUE;
201   }
202 
203   return FALSE;
204 }
205 
206 static SysKeyboardImpl *alloc_device(REFGUID rguid, const void *kvt, IDirectInputImpl *dinput)
207 {
208     SysKeyboardImpl* newDevice;
209     LPDIDATAFORMAT df = NULL;
210     int i, idx = 0;
211 
212     newDevice = HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,sizeof(SysKeyboardImpl));
213     newDevice->base.lpVtbl = kvt;
214     newDevice->base.ref = 1;
215     memcpy(&newDevice->base.guid, rguid, sizeof(*rguid));
216     newDevice->base.dinput = dinput;
217     newDevice->base.event_proc = KeyboardCallback;
218     InitializeCriticalSection(&newDevice->base.crit);
219     newDevice->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SysKeyboardImpl*->base.crit");
220 
221     /* Create copy of default data format */
222     if (!(df = HeapAlloc(GetProcessHeap(), 0, c_dfDIKeyboard.dwSize))) goto failed;
223     memcpy(df, &c_dfDIKeyboard, c_dfDIKeyboard.dwSize);
224     if (!(df->rgodf = HeapAlloc(GetProcessHeap(), 0, df->dwNumObjs * df->dwObjSize))) goto failed;
225 
226     for (i = 0; i < df->dwNumObjs; i++)
227     {
228         char buf[MAX_PATH];
229 
230         if (!GetKeyNameTextA(((i & 0x7f) << 16) | ((i & 0x80) << 17), buf, sizeof(buf)))
231             continue;
232 
233         memcpy(&df->rgodf[idx], &c_dfDIKeyboard.rgodf[i], df->dwObjSize);
234         df->rgodf[idx++].dwType = DIDFT_MAKEINSTANCE(i) | DIDFT_PSHBUTTON;
235     }
236     df->dwNumObjs = idx;
237 
238     newDevice->base.data_format.wine_df = df;
239     IDirectInput_AddRef((LPDIRECTINPUTDEVICE8A)newDevice->base.dinput);
240     return newDevice;
241 
242 failed:
243     if (df) HeapFree(GetProcessHeap(), 0, df->rgodf);
244     HeapFree(GetProcessHeap(), 0, df);
245     HeapFree(GetProcessHeap(), 0, newDevice);
246     return NULL;
247 }
248 
249 
250 static HRESULT keyboarddev_create_deviceA(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEA* pdev)
251 {
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);
261       if (!*pdev) return DIERR_OUTOFMEMORY;
262       return DI_OK;
263     } else
264       return DIERR_NOINTERFACE;
265   }
266   return DIERR_DEVICENOTREG;
267 }
268 
269 static HRESULT keyboarddev_create_deviceW(IDirectInputImpl *dinput, REFGUID rguid, REFIID riid, LPDIRECTINPUTDEVICEW* pdev)
270 {
271   if ((IsEqualGUID(&GUID_SysKeyboard,rguid)) ||          /* Generic Keyboard */
272       (IsEqualGUID(&DInput_Wine_Keyboard_GUID,rguid))) { /* Wine Keyboard */
273     if ((riid == NULL) ||
274         IsEqualGUID(&IID_IDirectInputDeviceW,riid) ||
275         IsEqualGUID(&IID_IDirectInputDevice2W,riid) ||
276         IsEqualGUID(&IID_IDirectInputDevice7W,riid) ||
277         IsEqualGUID(&IID_IDirectInputDevice8W,riid)) {
278       *pdev = (IDirectInputDeviceW*) alloc_device(rguid, &SysKeyboardWvt, dinput);
279       TRACE("Creating a Keyboard device (%p)\n", *pdev);
280       if (!*pdev) return DIERR_OUTOFMEMORY;
281       return DI_OK;
282     } else
283       return DIERR_NOINTERFACE;
284   }
285   return DIERR_DEVICENOTREG;
286 }
287 
288 const struct dinput_device keyboard_device = {
289   "Wine keyboard driver",
290   keyboarddev_enum_deviceA,
291   keyboarddev_enum_deviceW,
292   keyboarddev_create_deviceA,
293   keyboarddev_create_deviceW
294 };
295 
296 static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState(
297         LPDIRECTINPUTDEVICE8A iface,DWORD len,LPVOID ptr
298 )
299 {
300     SysKeyboardImpl *This = (SysKeyboardImpl *)iface;
301     TRACE("(%p)->(%d,%p)\n", This, len, ptr);
302 
303     if (!This->base.acquired) return DIERR_NOTACQUIRED;
304 
305     if (len != This->base.data_format.user_df->dwDataSize )
306         return DIERR_INVALIDPARAM;
307 
308     EnterCriticalSection(&This->base.crit);
309 
310     if (TRACE_ON(dinput)) {
311         int i;
312         for (i = 0; i < WINE_DINPUT_KEYBOARD_MAX_KEYS; i++) {
313             if (This->DInputKeyState[i] != 0x00)
314                 TRACE(" - %02X: %02x\n", i, This->DInputKeyState[i]);
315         }
316     }
317 
318     fill_DataFormat(ptr, len, This->DInputKeyState, &This->base.data_format);
319     LeaveCriticalSection(&This->base.crit);
320 
321     return DI_OK;
322 }
323 
324 /******************************************************************************
325   *     GetCapabilities : get the device capabilities
326   */
327 static HRESULT WINAPI SysKeyboardAImpl_GetCapabilities(
328         LPDIRECTINPUTDEVICE8A iface,
329         LPDIDEVCAPS lpDIDevCaps)
330 {
331     SysKeyboardImpl *This = (SysKeyboardImpl *)iface;
332     DIDEVCAPS devcaps;
333 
334     TRACE("(this=%p,%p)\n",This,lpDIDevCaps);
335 
336     if ((lpDIDevCaps->dwSize != sizeof(DIDEVCAPS)) && (lpDIDevCaps->dwSize != sizeof(DIDEVCAPS_DX3))) {
337         WARN("invalid parameter\n");
338         return DIERR_INVALIDPARAM;
339     }
340     
341     devcaps.dwSize = lpDIDevCaps->dwSize;
342     devcaps.dwFlags = DIDC_ATTACHED;
343     if (This->base.dinput->dwVersion >= 0x0800)
344         devcaps.dwDevType = DI8DEVTYPE_KEYBOARD | (DI8DEVTYPEKEYBOARD_UNKNOWN << 8);
345     else
346         devcaps.dwDevType = DIDEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_UNKNOWN << 8);
347     devcaps.dwAxes = 0;
348     devcaps.dwButtons = This->base.data_format.wine_df->dwNumObjs;
349     devcaps.dwPOVs = 0;
350     devcaps.dwFFSamplePeriod = 0;
351     devcaps.dwFFMinTimeResolution = 0;
352     devcaps.dwFirmwareRevision = 100;
353     devcaps.dwHardwareRevision = 100;
354     devcaps.dwFFDriverVersion = 0;
355 
356     memcpy(lpDIDevCaps, &devcaps, lpDIDevCaps->dwSize);
357     
358     return DI_OK;
359 }
360 
361 /******************************************************************************
362   *     GetObjectInfo : get information about a device object such as a button
363   *                     or axis
364   */
365 static HRESULT WINAPI
366 SysKeyboardAImpl_GetObjectInfo(
367         LPDIRECTINPUTDEVICE8A iface,
368         LPDIDEVICEOBJECTINSTANCEA pdidoi,
369         DWORD dwObj,
370         DWORD dwHow)
371 {
372     HRESULT res;
373 
374     res = IDirectInputDevice2AImpl_GetObjectInfo(iface, pdidoi, dwObj, dwHow);
375     if (res != DI_OK) return res;
376 
377     if (!GetKeyNameTextA((DIDFT_GETINSTANCE(pdidoi->dwType) & 0x80) << 17 |
378                          (DIDFT_GETINSTANCE(pdidoi->dwType) & 0x7f) << 16,
379                          pdidoi->tszName, sizeof(pdidoi->tszName)))
380         return DIERR_OBJECTNOTFOUND;
381 
382     _dump_OBJECTINSTANCEA(pdidoi);
383     return res;
384 }
385 
386 static HRESULT WINAPI SysKeyboardWImpl_GetObjectInfo(LPDIRECTINPUTDEVICE8W iface,
387                                                      LPDIDEVICEOBJECTINSTANCEW pdidoi,
388                                                      DWORD dwObj,
389                                                      DWORD dwHow)
390 {
391     HRESULT res;
392 
393     res = IDirectInputDevice2WImpl_GetObjectInfo(iface, pdidoi, dwObj, dwHow);
394     if (res != DI_OK) return res;
395 
396     if (!GetKeyNameTextW((DIDFT_GETINSTANCE(pdidoi->dwType) & 0x80) << 17 |
397                          (DIDFT_GETINSTANCE(pdidoi->dwType) & 0x7f) << 16,
398                          pdidoi->tszName,
399                          sizeof(pdidoi->tszName)/sizeof(pdidoi->tszName[0])))
400         return DIERR_OBJECTNOTFOUND;
401 
402     _dump_OBJECTINSTANCEW(pdidoi);
403     return res;
404 }
405 
406 /******************************************************************************
407   *     GetDeviceInfo : get information about a device's identity
408   */
409 static HRESULT WINAPI SysKeyboardAImpl_GetDeviceInfo(
410         LPDIRECTINPUTDEVICE8A iface,
411         LPDIDEVICEINSTANCEA pdidi)
412 {
413     SysKeyboardImpl *This = (SysKeyboardImpl *)iface;
414     TRACE("(this=%p,%p)\n", This, pdidi);
415 
416     if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEA)) {
417         WARN(" dinput3 not supported yet...\n");
418         return DI_OK;
419     }
420 
421     fill_keyboard_dideviceinstanceA(pdidi, This->base.dinput->dwVersion);
422     
423     return DI_OK;
424 }
425 
426 static HRESULT WINAPI SysKeyboardWImpl_GetDeviceInfo(LPDIRECTINPUTDEVICE8W iface, LPDIDEVICEINSTANCEW pdidi) 
427 {
428     SysKeyboardImpl *This = (SysKeyboardImpl *)iface;
429     TRACE("(this=%p,%p)\n", This, pdidi);
430 
431     if (pdidi->dwSize != sizeof(DIDEVICEINSTANCEW)) {
432         WARN(" dinput3 not supported yet...\n");
433         return DI_OK;
434     }
435 
436     fill_keyboard_dideviceinstanceW(pdidi, This->base.dinput->dwVersion);
437     
438     return DI_OK;
439 }
440 
441 /******************************************************************************
442  *      GetProperty : Retrieves information about the input device.
443  */
444 static HRESULT WINAPI SysKeyboardAImpl_GetProperty(LPDIRECTINPUTDEVICE8A iface,
445         REFGUID rguid, LPDIPROPHEADER pdiph)
446 {
447     TRACE("(%p) %s,%p\n", iface, debugstr_guid(rguid), pdiph);
448     _dump_DIPROPHEADER(pdiph);
449 
450     if (HIWORD(rguid)) return DI_OK;
451 
452     switch (LOWORD(rguid))
453     {
454         case (DWORD_PTR)DIPROP_KEYNAME:
455         {
456             HRESULT hr;
457             LPDIPROPSTRING ps = (LPDIPROPSTRING)pdiph;
458             DIDEVICEOBJECTINSTANCEW didoi;
459 
460             if (pdiph->dwSize != sizeof(DIPROPSTRING))
461                 return DIERR_INVALIDPARAM;
462 
463             didoi.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW);
464 
465             hr = SysKeyboardWImpl_GetObjectInfo((LPDIRECTINPUTDEVICE8W)iface , &didoi,
466                                                  ps->diph.dwObj, ps->diph.dwHow);
467             if (hr == DI_OK)
468                 memcpy(ps->wsz, didoi.tszName, sizeof(ps->wsz));
469             return hr;
470         }
471         default:
472             return IDirectInputDevice2AImpl_GetProperty( iface, rguid, pdiph );
473     }
474     return DI_OK;
475 }
476 
477 static const IDirectInputDevice8AVtbl SysKeyboardAvt =
478 {
479         IDirectInputDevice2AImpl_QueryInterface,
480         IDirectInputDevice2AImpl_AddRef,
481         IDirectInputDevice2AImpl_Release,
482         SysKeyboardAImpl_GetCapabilities,
483         IDirectInputDevice2AImpl_EnumObjects,
484         SysKeyboardAImpl_GetProperty,
485         IDirectInputDevice2AImpl_SetProperty,
486         IDirectInputDevice2AImpl_Acquire,
487         IDirectInputDevice2AImpl_Unacquire,
488         SysKeyboardAImpl_GetDeviceState,
489         IDirectInputDevice2AImpl_GetDeviceData,
490         IDirectInputDevice2AImpl_SetDataFormat,
491         IDirectInputDevice2AImpl_SetEventNotification,
492         IDirectInputDevice2AImpl_SetCooperativeLevel,
493         SysKeyboardAImpl_GetObjectInfo,
494         SysKeyboardAImpl_GetDeviceInfo,
495         IDirectInputDevice2AImpl_RunControlPanel,
496         IDirectInputDevice2AImpl_Initialize,
497         IDirectInputDevice2AImpl_CreateEffect,
498         IDirectInputDevice2AImpl_EnumEffects,
499         IDirectInputDevice2AImpl_GetEffectInfo,
500         IDirectInputDevice2AImpl_GetForceFeedbackState,
501         IDirectInputDevice2AImpl_SendForceFeedbackCommand,
502         IDirectInputDevice2AImpl_EnumCreatedEffectObjects,
503         IDirectInputDevice2AImpl_Escape,
504         IDirectInputDevice2AImpl_Poll,
505         IDirectInputDevice2AImpl_SendDeviceData,
506         IDirectInputDevice7AImpl_EnumEffectsInFile,
507         IDirectInputDevice7AImpl_WriteEffectToFile,
508         IDirectInputDevice8AImpl_BuildActionMap,
509         IDirectInputDevice8AImpl_SetActionMap,
510         IDirectInputDevice8AImpl_GetImageInfo
511 };
512 
513 #if !defined(__STRICT_ANSI__) && defined(__GNUC__)
514 # define XCAST(fun)     (typeof(SysKeyboardWvt.fun))
515 #else
516 # define XCAST(fun)     (void*)
517 #endif
518 
519 static const IDirectInputDevice8WVtbl SysKeyboardWvt =
520 {
521         IDirectInputDevice2WImpl_QueryInterface,
522         XCAST(AddRef)IDirectInputDevice2AImpl_AddRef,
523         XCAST(Release)IDirectInputDevice2AImpl_Release,
524         XCAST(GetCapabilities)SysKeyboardAImpl_GetCapabilities,
525         IDirectInputDevice2WImpl_EnumObjects,
526         XCAST(GetProperty)SysKeyboardAImpl_GetProperty,
527         XCAST(SetProperty)IDirectInputDevice2AImpl_SetProperty,
528         XCAST(Acquire)IDirectInputDevice2AImpl_Acquire,
529         XCAST(Unacquire)IDirectInputDevice2AImpl_Unacquire,
530         XCAST(GetDeviceState)SysKeyboardAImpl_GetDeviceState,
531         XCAST(GetDeviceData)IDirectInputDevice2AImpl_GetDeviceData,
532         XCAST(SetDataFormat)IDirectInputDevice2AImpl_SetDataFormat,
533         XCAST(SetEventNotification)IDirectInputDevice2AImpl_SetEventNotification,
534         XCAST(SetCooperativeLevel)IDirectInputDevice2AImpl_SetCooperativeLevel,
535         SysKeyboardWImpl_GetObjectInfo,
536         SysKeyboardWImpl_GetDeviceInfo,
537         XCAST(RunControlPanel)IDirectInputDevice2AImpl_RunControlPanel,
538         XCAST(Initialize)IDirectInputDevice2AImpl_Initialize,
539         XCAST(CreateEffect)IDirectInputDevice2AImpl_CreateEffect,
540         IDirectInputDevice2WImpl_EnumEffects,
541         IDirectInputDevice2WImpl_GetEffectInfo,
542         XCAST(GetForceFeedbackState)IDirectInputDevice2AImpl_GetForceFeedbackState,
543         XCAST(SendForceFeedbackCommand)IDirectInputDevice2AImpl_SendForceFeedbackCommand,
544         XCAST(EnumCreatedEffectObjects)IDirectInputDevice2AImpl_EnumCreatedEffectObjects,
545         XCAST(Escape)IDirectInputDevice2AImpl_Escape,
546         XCAST(Poll)IDirectInputDevice2AImpl_Poll,
547         XCAST(SendDeviceData)IDirectInputDevice2AImpl_SendDeviceData,
548         IDirectInputDevice7WImpl_EnumEffectsInFile,
549         IDirectInputDevice7WImpl_WriteEffectToFile,
550         IDirectInputDevice8WImpl_BuildActionMap,
551         IDirectInputDevice8WImpl_SetActionMap,
552         IDirectInputDevice8WImpl_GetImageInfo
553 };
554 #undef XCAST
555 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~ [ freetext search ] ~ [ file search ] ~

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.