Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "wine/debug.h"
- #include "windef.h"
- #include "objbase.h"
- //#include "winbase.h"
- //#include "winuser.h"
- //#include "winerror.h"
- #include "wine/asm.h"
- #include "dinput_local.h"
- #include <linux/input.h>
- #include <sys/stat.h>
- #include <fcntl.h>
- #include <unistd.h>
- #include <time.h>
- #include <stdlib.h>
- #include <errno.h>
- #include <pthread.h>
- WINE_DEFAULT_DEBUG_CHANNEL(dinput);
- #define sizeof_member(type, member) sizeof(((type *)0)->member)
- static unsigned long long last;
- static const IDirectInput8AVtbl ddi8avt;
- static const IDirectInputDevice8AVtbl SysMouseAvt;
- static const IDirectInputDevice8AVtbl SysKeyboardAvt;
- /* Implementation specification */
- typedef struct IDirectInputImpl IDirectInputImpl;
- struct IDirectInputImpl
- {
- //IDirectInput7A IDirectInput7A_iface;
- //IDirectInput7W IDirectInput7W_iface;
- IDirectInput8A IDirectInput8A_iface;
- //IDirectInput8W IDirectInput8W_iface;
- //IDirectInputJoyConfig8 IDirectInputJoyConfig8_iface;
- LONG ref;
- BOOL initialized;
- CRITICAL_SECTION crit;
- //struct list entry; /* entry into list of all IDirectInputs */
- DWORD evsequence; /* unique sequence number for events */
- DWORD dwVersion; /* direct input version number */
- //struct list devices_list; /* list of all created dinput devices */
- //struct list device_players; /* device instance guid to player name */
- };
- /* Device implementation */
- typedef struct IDirectInputDeviceImpl IDirectInputDeviceImpl;
- struct IDirectInputDeviceImpl
- {
- IDirectInputDevice8A IDirectInputDevice8A_iface;
- int acquired;
- int fd;
- struct input_event input_events[64];
- int n_events;
- BOOL grab_mouse;
- DIMOUSESTATE2 mouse_state;
- char keyboard_state[256];
- HWND win;
- // IDirectInputDevice8W IDirectInputDevice8W_iface;
- // LONG ref;
- // GUID guid;
- // CRITICAL_SECTION crit;
- // IDirectInputImpl *dinput;
- // struct list entry; /* entry into IDirectInput devices list */
- // HANDLE hEvent;
- // DWORD dwCoopLevel;
- // HWND win;
- // int acquired;
- // DI_EVENT_PROC event_proc; /* function to receive mouse & keyboard events */
- //
- // BOOL use_raw_input; /* use raw input instead of low-level messages */
- // RAWINPUTDEVICE raw_device; /* raw device to (un)register */
- //
- // LPDIDEVICEOBJECTDATA data_queue; /* buffer for 'GetDeviceData'. */
- // int queue_len; /* size of the queue - set in 'SetProperty' */
- // int queue_head; /* position to write new event into queue */
- // int queue_tail; /* next event to read from queue */
- // BOOL overflow; /* return DI_BUFFEROVERFLOW in 'GetDeviceData' */
- //
- // DataFormat data_format; /* user data format and wine to user format converter */
- //
- // /* Action mapping */
- // int num_actions; /* number of actions mapped */
- // ActionMap *action_map; /* array of mappings */
- };
- static inline IDirectInputImpl *impl_from_IDirectInput8A( IDirectInput8A *iface )
- {
- return CONTAINING_RECORD( iface, IDirectInputImpl, IDirectInput8A_iface );
- }
- static inline IDirectInputDeviceImpl *impl_from_IDirectInputDevice8A(IDirectInputDevice8A *iface)
- {
- return CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8A_iface);
- }
- /* Enumeration */
- /******************************************************************************
- * DirectInput8Create (DINPUT8.@)
- */
- HRESULT WINAPI DECLSPEC_HOTPATCH DirectInput8Create(HINSTANCE hinst,
- DWORD version, REFIID iid, void **out, IUnknown *outer)
- {
- IDirectInputImpl *This = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectInputImpl) );
- TRACE("hinst %p, version %#x, iid %s, out %p, outer %p.\n",
- hinst, version, debugstr_guid(iid), out, outer);
- This->IDirectInput8A_iface.lpVtbl = &ddi8avt;
- *out = &This->IDirectInput8A_iface;
- return S_OK;
- }
- static ULONG WINAPI IDirectInputAImpl_Release(LPDIRECTINPUT8A iface)
- {
- IDirectInputImpl *This = impl_from_IDirectInput8A(iface);
- HeapFree( GetProcessHeap(), 0, This );
- return 0;
- }
- static void _dump_EnumDevices_dwFlags(DWORD dwFlags)
- {
- if (TRACE_ON(dinput)) {
- unsigned int i;
- static const struct {
- DWORD mask;
- const char *name;
- } flags[] = {
- #define FE(x) { x, #x}
- FE(DIEDFL_ALLDEVICES),
- FE(DIEDFL_ATTACHEDONLY),
- FE(DIEDFL_FORCEFEEDBACK),
- FE(DIEDFL_INCLUDEALIASES),
- FE(DIEDFL_INCLUDEPHANTOMS),
- FE(DIEDFL_INCLUDEHIDDEN)
- #undef FE
- };
- TRACE(" flags: ");
- if (dwFlags == 0) {
- TRACE("DIEDFL_ALLDEVICES\n");
- return;
- }
- for (i = 0; i < ARRAY_SIZE(flags); i++)
- if (flags[i].mask & dwFlags)
- TRACE("%s ",flags[i].name);
- }
- TRACE("\n");
- }
- static const char *_dump_DIDEVTYPE_value(DWORD dwDevType)
- {
- switch (dwDevType) {
- case 0: return "All devices";
- case DIDEVTYPE_MOUSE: return "DIDEVTYPE_MOUSE";
- case DIDEVTYPE_KEYBOARD: return "DIDEVTYPE_KEYBOARD";
- case DIDEVTYPE_JOYSTICK: return "DIDEVTYPE_JOYSTICK";
- case DIDEVTYPE_DEVICE: return "DIDEVTYPE_DEVICE";
- default: return "Unknown";
- }
- }
- #if defined __i386__ && defined _MSC_VER
- __declspec(naked) BOOL enum_callback_wrapper(void *callback, const void *instance, void *ref)
- {
- __asm
- {
- push ebp
- mov ebp, esp
- push [ebp+16]
- push [ebp+12]
- call [ebp+8]
- leave
- ret
- }
- }
- #elif defined __i386__ && defined __GNUC__
- extern BOOL enum_callback_wrapper(void *callback, const void *instance, void *ref);
- __ASM_GLOBAL_FUNC( enum_callback_wrapper,
- "pushl %ebp\n\t"
- __ASM_CFI(".cfi_adjust_cfa_offset 4\n\t")
- __ASM_CFI(".cfi_rel_offset %ebp,0\n\t")
- "movl %esp,%ebp\n\t"
- __ASM_CFI(".cfi_def_cfa_register %ebp\n\t")
- "pushl 16(%ebp)\n\t"
- "pushl 12(%ebp)\n\t"
- "call *8(%ebp)\n\t"
- "leave\n\t"
- __ASM_CFI(".cfi_def_cfa %esp,4\n\t")
- __ASM_CFI(".cfi_same_value %ebp\n\t")
- "ret" )
- #else
- #define enum_callback_wrapper(callback, instance, ref) (callback)((instance), (ref))
- #endif
- static HRESULT WINAPI IDirectInput8AImpl_EnumDevices(LPDIRECTINPUT8A iface, DWORD dwDevType, LPDIENUMDEVICESCALLBACKA lpCallback,
- LPVOID pvRef, DWORD dwFlags)
- {
- DIDEVICEINSTANCEA ddi;
- TRACE("(0x%04x '%s',%p,%p,0x%04x)\n",
- dwDevType, _dump_DIDEVTYPE_value(dwDevType),
- lpCallback, pvRef, dwFlags);
- _dump_EnumDevices_dwFlags(dwFlags);
- TRACE("enum mouse\n");
- memset(&ddi, 0, sizeof(ddi));
- ddi.dwSize = sizeof(ddi);
- ddi.guidInstance = GUID_SysMouse;/* DInput's GUID */
- ddi.guidProduct = GUID_SysMouse;
- ddi.dwDevType = DI8DEVTYPE_MOUSE | (DI8DEVTYPEMOUSE_TRADITIONAL << 8);
- strcpy(ddi.tszInstanceName, "Mouse");
- strcpy(ddi.tszProductName, "Wine Mouse");
- if (enum_callback_wrapper(lpCallback, &ddi, pvRef) == DIENUM_STOP)
- return S_OK;
- TRACE("enum keyboard\n");
- memset(&ddi, 0, sizeof(ddi));
- ddi.dwSize = sizeof(ddi);
- ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
- ddi.guidProduct = GUID_SysKeyboard;
- ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (DIDEVTYPEKEYBOARD_PCENH << 8);
- strcpy(ddi.tszInstanceName, "Keyboard");
- strcpy(ddi.tszProductName, "Wine Keyboard");
- if (enum_callback_wrapper(lpCallback, &ddi, pvRef) == DIENUM_STOP)
- return S_OK;
- return S_OK;
- }
- static HRESULT WINAPI IDirectInput8AImpl_CreateDevice(LPDIRECTINPUT8A iface, REFGUID rguid,
- LPDIRECTINPUTDEVICE8A* pdev, LPUNKNOWN punk)
- {
- if (IsEqualGUID(&GUID_SysMouse, rguid))
- {
- IDirectInputDeviceImpl *newDevice = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectInputDeviceImpl));
- TRACE("(%s, %p, %p)\n", debugstr_guid(rguid), pdev, punk);
- newDevice->IDirectInputDevice8A_iface.lpVtbl = &SysMouseAvt;
- *pdev = &newDevice->IDirectInputDevice8A_iface;
- }
- if (IsEqualGUID(&GUID_SysKeyboard, rguid))
- {
- IDirectInputDeviceImpl *newDevice = HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(IDirectInputDeviceImpl));
- TRACE("(%s, %p, %p)\n", debugstr_guid(rguid), pdev, punk);
- newDevice->IDirectInputDevice8A_iface.lpVtbl = &SysKeyboardAvt;
- *pdev = &newDevice->IDirectInputDevice8A_iface;
- }
- return DI_OK;
- }
- // MOUSE --------------------------------------------------------------------
- HRESULT WINAPI SysMouseAImpl_SetDataFormat(LPDIRECTINPUTDEVICE8A iface, LPCDIDATAFORMAT df)
- {
- TRACE("%p\n", df);
- return DI_OK;
- }
- HRESULT WINAPI SysMouseAImpl_SetProperty(
- LPDIRECTINPUTDEVICE8A iface, REFGUID rguid, LPCDIPROPHEADER pdiph)
- {
- TRACE("(%s,%p)\n",debugstr_guid(rguid), pdiph);
- return DI_OK;
- }
- static HRESULT WINAPI SysMouseAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface)
- {
- TRACE("dim\n");
- IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface);
- close(This->fd);
- memset(&This->mouse_state, 0, sizeof(DIMOUSESTATE2));
- This->acquired = 0;
- return DI_OK;
- }
- static HRESULT WINAPI SysMouseAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
- {
- TRACE("dim\n");
- IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface);
- if (This->win != GetForegroundWindow())
- {
- //was previously acquired
- if (This->acquired == 1)
- {
- SysMouseAImpl_Unacquire(iface);
- }
- return E_ACCESSDENIED; // = DIERR_OTHERAPPHASPRIO;
- }
- //was previously unacquired
- if (!This->acquired)
- {
- This->fd = open("/dev/input/by-id/usb-Logitech_G_Pro_Gaming_Mouse_158936703032-event-mouse", O_RDONLY | O_NONBLOCK);
- }
- This->acquired = 1;
- return DI_OK;
- }
- HRESULT WINAPI SysMouseAImpl_SetCooperativeLevel(LPDIRECTINPUTDEVICE8A iface, HWND hwnd, DWORD dwflags)
- {
- TRACE("dim\n");
- IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface);
- This->win = hwnd;
- return DI_OK;
- }
- ULONG WINAPI SysMouseImpl_Release(LPDIRECTINPUTDEVICE8A iface)
- {
- IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface);
- TRACE("dim\n");
- HeapFree( GetProcessHeap(), 0, This );
- return 0;
- }
- static HRESULT WINAPI SysMouseAImpl_GetDeviceState(LPDIRECTINPUTDEVICE8A iface, DWORD len, LPVOID ptr)
- {
- int rsize;
- struct timespec ts_now;
- unsigned long long now;
- unsigned long long ev_time_delta;
- IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface);
- TRACE("(%p)->(%u,%p)\n", This, len, ptr);
- //if (!This->acquired)
- // return DI_OK;
- if (!This->grab_mouse)
- {
- clock_gettime(CLOCK_MONOTONIC, &ts_now);
- now = (unsigned long long)ts_now.tv_sec *1000000000ULL + (unsigned long long)ts_now.tv_nsec;
- ev_time_delta = now - last;
- if (ev_time_delta/1000 < 16600)
- usleep(16600 - ev_time_delta/1000);
- clock_gettime(CLOCK_MONOTONIC, &ts_now);
- now = (unsigned long long)ts_now.tv_sec *1000000000ULL + (unsigned long long)ts_now.tv_nsec;
- last = now;
- }
- if (This->win != GetForegroundWindow() || !This->acquired)
- {
- return DIERR_NOTACQUIRED;
- }
- //while((rsize = read(This->fd, &This->input_events[0], sizeof_member(IDirectInputDeviceImpl, input_events))) > 0)
- while(1)
- {
- rsize = read(This->fd, &This->input_events[0], sizeof_member(IDirectInputDeviceImpl, input_events));
- //rsize = read(This->fd, &This->input_events[0], sizeof(struct input_event));
- if (rsize < 0)
- {
- if(errno == EAGAIN)
- {
- break;
- }
- else continue;
- }
- int n_events = rsize / sizeof(struct input_event);
- This->n_events = n_events;
- for(int i = 0; i < n_events; i++)
- {
- if (This->input_events[i].type == EV_REL)
- {
- switch (This->input_events[i].code)
- {
- case REL_X:
- This->mouse_state.lX += This->input_events[i].value;
- break;
- case REL_Y:
- This->mouse_state.lY += This->input_events[i].value;
- break;
- case REL_WHEEL:
- This->mouse_state.lZ = This->input_events[i].value;
- }
- }
- else if (This->input_events[i].type == EV_KEY)
- {
- switch (This->input_events[i].code)
- {
- case BTN_LEFT:
- This->mouse_state.rgbButtons[0] = This->input_events[i].value ? 0x80 : 0x00;
- break;
- case BTN_RIGHT:
- This->mouse_state.rgbButtons[1] = This->input_events[i].value ? 0x80 : 0x00;
- break;
- case BTN_MIDDLE:
- This->mouse_state.rgbButtons[2] = This->input_events[i].value ? 0x80 : 0x00;
- break;
- case BTN_EXTRA:
- if (!This->input_events[i].value)
- {
- This->grab_mouse ^= 1;
- if (This->grab_mouse)
- {
- //system("/usr/bin/xinput --disable 9");
- system("/usr/bin/xinput --set-prop 9 277 1, 0");
- system("/usr/bin/xinput --set-prop 13 277 1, 0");
- //ioctl(This->fd, EVIOCGRAB,1);
- //if (!This->active_window)
- // This->active_window = GetActiveWindow();
- //else
- // SetActiveWindow(This->active_window);
- }
- else
- {
- //ioctl(This->fd, EVIOCGRAB,0);
- //system("/usr/bin/xinput --enable 9");
- system("/usr/bin/xinput --set-prop 9 277 0, 0");
- system("/usr/bin/xinput --set-prop 13 277 0, 0");
- }
- }
- break;
- }
- }
- }
- }
- memcpy(ptr, &This->mouse_state, len);
- This->mouse_state.lX = 0;
- This->mouse_state.lY = 0;
- This->mouse_state.lZ = 0;
- return DI_OK;
- }
- static HRESULT WINAPI SysMouseAImpl_GetDeviceData(LPDIRECTINPUTDEVICE8A iface,
- DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags)
- {
- int e = 0;
- static int seq = 0;
- IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface);
- TRACE("dim %p %d %p %d %d\n", iface, dodsize, dod, *entries, flags);
- if (!This->acquired)
- return DIERR_NOTACQUIRED;
- if (*entries <= 0 || dod == NULL)
- return DI_OK;
- for(int i = 0; i < This->n_events; i++)
- {
- if (This->input_events[i].type == EV_KEY)
- {
- LPDIDEVICEOBJECTDATA dod_ = ((char*)dod) + dodsize * e;
- switch (This->input_events[i].code)
- {
- case BTN_LEFT:
- if (e >= *entries) break;
- dod_->dwOfs = DIMOFS_BUTTON0;
- dod_->dwData = This->input_events[i].value ? 0x80 : 0x00;
- dod_->dwTimeStamp = 0;
- dod_->dwSequence = seq++;
- dod_->uAppData = 0;
- e++;
- break;
- case BTN_RIGHT:
- if (e >= *entries) break;
- dod_->dwOfs = DIMOFS_BUTTON1;
- dod_->dwData = This->input_events[i].value ? 0x80 : 0x00;
- dod_->dwTimeStamp = 0;
- dod_->dwSequence = seq++;
- dod_->uAppData = 0;
- e++;
- break;
- case BTN_MIDDLE:
- if (e >= *entries) break;
- dod_->dwOfs = DIMOFS_BUTTON2;
- dod_->dwData = This->input_events[i].value ? 0x80 : 0x00;
- dod_->dwTimeStamp = 0;
- dod_->dwSequence = seq++;
- dod_->uAppData = 0;
- e++;
- break;
- }
- }
- }
- *entries = e;
- return DI_OK;
- }
- // KEYBOARD -----------------------------------------------------------------
- static HRESULT WINAPI SysKeyboardAImpl_Unacquire(LPDIRECTINPUTDEVICE8A iface)
- {
- IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface);
- TRACE("dim\n");
- memset(This->keyboard_state, 0, 256);
- close(This->fd);
- This->acquired = 0;
- return DI_OK;
- }
- static HRESULT WINAPI SysKeyboardAImpl_Acquire(LPDIRECTINPUTDEVICE8A iface)
- {
- TRACE("dim\n");
- IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface);
- if (This->win != GetForegroundWindow())
- {
- //was previously acquired
- if (This->acquired == 1)
- {
- SysKeyboardAImpl_Unacquire(iface);
- }
- This->acquired = 0;
- return E_ACCESSDENIED; // = DIERR_OTHERAPPHASPRIO
- }
- //was previously unacquired
- if (!This->acquired)
- {
- This->fd = open("/dev/input/event3", O_RDONLY |O_NONBLOCK);
- }
- This->acquired = 1;
- return DI_OK;
- }
- static HRESULT WINAPI SysKeyboardAImpl_GetDeviceState(LPDIRECTINPUTDEVICE8A iface, DWORD len, LPVOID ptr)
- {
- int rsize;
- int scan = 0;
- int n_events;
- IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface);
- TRACE("dim\n");
- if (This->win != GetForegroundWindow() || !This->acquired)
- {
- memcpy(ptr, This->keyboard_state, 256);
- return DIERR_NOTACQUIRED;
- }
- //if (!This->acquired)
- // return DI_OK;
- //while((rsize = read(This->fd, &This->input_events[0], sizeof_member(IDirectInputDeviceImpl, input_events))) > 0)
- while(1)
- {
- rsize = read(This->fd, &This->input_events[0], sizeof_member(IDirectInputDeviceImpl, input_events));
- //rsize = read(This->fd, &This->input_events[0], sizeof(struct input_event));
- if (rsize < 0)
- {
- if(errno == EAGAIN)
- {
- break;
- }
- else continue;
- }
- n_events = rsize / sizeof(struct input_event);
- This->n_events = n_events;
- for(int i = 0; i < n_events; i++)
- {
- if(This->input_events[i].type == 4)
- {
- scan = This->input_events[i].value;
- if (scan == 221)
- scan = 57;
- }
- else if(This->input_events[i].type == 1 && This->input_events[i].value == 1)
- {
- This->keyboard_state[scan] = 0x80;
- }
- else if(This->input_events[i].type == 1 && This->input_events[i].value == 0)
- {
- This->keyboard_state[scan] = 0x00;
- }
- }
- }
- memcpy(ptr, This->keyboard_state, 256);
- return DI_OK;
- }
- static HRESULT WINAPI SysKeyboardAImpl_GetDeviceData(LPDIRECTINPUTDEVICE8A iface,
- DWORD dodsize, LPDIDEVICEOBJECTDATA dod, LPDWORD entries, DWORD flags)
- {
- int scan = 0;
- int e = 0;
- static int seq = 0;
- IDirectInputDeviceImpl *This = impl_from_IDirectInputDevice8A(iface);
- TRACE("dim %p %d %p %d %d\n", iface, dodsize, dod, *entries, flags);
- if (!This->acquired)
- return DIERR_NOTACQUIRED;
- if (*entries <= 0 || dod == NULL)
- return DI_OK;
- for(int i = 0; i < This->n_events; i++)
- {
- if(This->input_events[i].type == 4)
- {
- scan = This->input_events[i].value;
- if (scan == 221)
- scan = 57;
- }
- else if(This->input_events[i].type == 1 && This->input_events[i].value == 1)
- {
- if (e >= *entries) break;
- LPDIDEVICEOBJECTDATA dod_ = ((char*)dod) + dodsize * e;
- dod_->dwOfs = scan;
- dod_->dwData = 0x80;
- dod_->dwTimeStamp = 0;
- dod_->dwSequence = seq++;
- dod_->uAppData = 0;
- e++;
- }
- else if(This->input_events[i].type == 1 && This->input_events[i].value == 0)
- {
- if (e >= *entries) break;
- LPDIDEVICEOBJECTDATA dod_ = ((char*)dod) + dodsize * e;
- dod_->dwOfs = scan;
- dod_->dwData = 0x00;
- dod_->dwTimeStamp = 0;
- dod_->dwSequence = seq++;
- dod_->uAppData = 0;
- e++;
- }
- }
- *entries = e;
- return DI_OK;
- }
- // VTB ----------------------------------------------------------------------
- //static const IDirectInput8AVtbl ddi8avt = {
- // IDirectInput8AImpl_QueryInterface,
- // IDirectInput8AImpl_AddRef,
- // IDirectInput8AImpl_Release,
- // IDirectInput8AImpl_CreateDevice,
- // IDirectInput8AImpl_EnumDevices,
- // IDirectInput8AImpl_GetDeviceStatus,
- // IDirectInput8AImpl_RunControlPanel,
- // IDirectInput8AImpl_Initialize,
- // IDirectInput8AImpl_FindDevice,
- // IDirectInput8AImpl_EnumDevicesBySemantics,
- // IDirectInput8AImpl_ConfigureDevices
- //};
- static const IDirectInput8AVtbl ddi8avt = {
- NULL,
- NULL,
- IDirectInputAImpl_Release,
- IDirectInput8AImpl_CreateDevice,
- IDirectInput8AImpl_EnumDevices,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
- };
- //static const IDirectInputDevice8AVtbl SysMouseAvt =
- //{
- // IDirectInputDevice2AImpl_QueryInterface,
- // IDirectInputDevice2AImpl_AddRef,
- // IDirectInputDevice2AImpl_Release,
- // SysMouseAImpl_GetCapabilities,
- // IDirectInputDevice2AImpl_EnumObjects,
- // SysMouseAImpl_GetProperty,
- // IDirectInputDevice2AImpl_SetProperty,
- // SysMouseAImpl_Acquire,
- // SysMouseAImpl_Unacquire,
- // SysMouseAImpl_GetDeviceState,
- // SysMouseAImpl_GetDeviceData,
- // IDirectInputDevice2AImpl_SetDataFormat,
- // IDirectInputDevice2AImpl_SetEventNotification,
- // IDirectInputDevice2AImpl_SetCooperativeLevel,
- // SysMouseAImpl_GetObjectInfo,
- // SysMouseAImpl_GetDeviceInfo,
- // IDirectInputDevice2AImpl_RunControlPanel,
- // IDirectInputDevice2AImpl_Initialize,
- // IDirectInputDevice2AImpl_CreateEffect,
- // IDirectInputDevice2AImpl_EnumEffects,
- // IDirectInputDevice2AImpl_GetEffectInfo,
- // IDirectInputDevice2AImpl_GetForceFeedbackState,
- // IDirectInputDevice2AImpl_SendForceFeedbackCommand,
- // IDirectInputDevice2AImpl_EnumCreatedEffectObjects,
- // IDirectInputDevice2AImpl_Escape,
- // IDirectInputDevice2AImpl_Poll,
- // IDirectInputDevice2AImpl_SendDeviceData,
- // IDirectInputDevice7AImpl_EnumEffectsInFile,
- // IDirectInputDevice7AImpl_WriteEffectToFile,
- // SysMouseAImpl_BuildActionMap,
- // SysMouseAImpl_SetActionMap,
- // IDirectInputDevice8AImpl_GetImageInfo
- //};
- static const IDirectInputDevice8AVtbl SysMouseAvt =
- {
- NULL,
- NULL,
- SysMouseImpl_Release,
- NULL,
- NULL,
- NULL,
- SysMouseAImpl_SetProperty,
- SysMouseAImpl_Acquire,
- SysMouseAImpl_Unacquire,
- SysMouseAImpl_GetDeviceState,
- SysMouseAImpl_GetDeviceData,
- SysMouseAImpl_SetDataFormat,
- NULL,
- SysMouseAImpl_SetCooperativeLevel,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
- };
- //static const IDirectInputDevice8AVtbl SysKeyboardAvt =
- //{
- // IDirectInputDevice2AImpl_QueryInterface,
- // IDirectInputDevice2AImpl_AddRef,
- // IDirectInputDevice2AImpl_Release,
- // SysKeyboardAImpl_GetCapabilities,
- // IDirectInputDevice2AImpl_EnumObjects,
- // SysKeyboardAImpl_GetProperty,
- // IDirectInputDevice2AImpl_SetProperty,
- // SysKeyboardAImpl_Acquire,
- // IDirectInputDevice2AImpl_Unacquire,
- // SysKeyboardAImpl_GetDeviceState,
- // IDirectInputDevice2AImpl_GetDeviceData,
- // IDirectInputDevice2AImpl_SetDataFormat,
- // IDirectInputDevice2AImpl_SetEventNotification,
- // IDirectInputDevice2AImpl_SetCooperativeLevel,
- // SysKeyboardAImpl_GetObjectInfo,
- // SysKeyboardAImpl_GetDeviceInfo,
- // IDirectInputDevice2AImpl_RunControlPanel,
- // IDirectInputDevice2AImpl_Initialize,
- // IDirectInputDevice2AImpl_CreateEffect,
- // IDirectInputDevice2AImpl_EnumEffects,
- // IDirectInputDevice2AImpl_GetEffectInfo,
- // IDirectInputDevice2AImpl_GetForceFeedbackState,
- // IDirectInputDevice2AImpl_SendForceFeedbackCommand,
- // IDirectInputDevice2AImpl_EnumCreatedEffectObjects,
- // IDirectInputDevice2AImpl_Escape,
- // IDirectInputDevice2AImpl_Poll,
- // IDirectInputDevice2AImpl_SendDeviceData,
- // IDirectInputDevice7AImpl_EnumEffectsInFile,
- // IDirectInputDevice7AImpl_WriteEffectToFile,
- // SysKeyboardAImpl_BuildActionMap,
- // SysKeyboardAImpl_SetActionMap,
- // IDirectInputDevice8AImpl_GetImageInfo
- //};
- static const IDirectInputDevice8AVtbl SysKeyboardAvt =
- {
- NULL,
- NULL,
- SysMouseImpl_Release,
- NULL,
- NULL,
- NULL,
- SysMouseAImpl_SetProperty,
- SysKeyboardAImpl_Acquire,
- SysKeyboardAImpl_Unacquire,
- SysKeyboardAImpl_GetDeviceState,
- SysKeyboardAImpl_GetDeviceData,
- SysMouseAImpl_SetDataFormat,
- NULL,
- SysMouseAImpl_SetCooperativeLevel,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement