2000-11-05 21:25:02 +01:00
|
|
|
/* DirectInput Keyboard device
|
|
|
|
*
|
|
|
|
* Copyright 1998 Marcus Meissner
|
|
|
|
* Copyright 1998,1999 Lionel Ulmer
|
2002-06-14 02:39:44 +02:00
|
|
|
* Copyright 2000-2001 TransGaming Technologies Inc.
|
2005-03-24 16:08:27 +01:00
|
|
|
* Copyright 2005 Raphael Junqueira
|
2000-11-05 21:25:02 +01:00
|
|
|
*
|
2002-03-10 00:29:33 +01:00
|
|
|
* This library is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU Lesser General Public
|
|
|
|
* License as published by the Free Software Foundation; either
|
|
|
|
* version 2.1 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
* Lesser General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU Lesser General Public
|
|
|
|
* License along with this library; if not, write to the Free Software
|
2006-05-18 14:49:52 +02:00
|
|
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
2000-11-05 21:25:02 +01:00
|
|
|
*/
|
|
|
|
|
2003-09-06 01:08:26 +02:00
|
|
|
#include <stdarg.h>
|
2000-11-05 21:25:02 +01:00
|
|
|
#include <string.h>
|
2003-09-06 01:08:26 +02:00
|
|
|
#include "windef.h"
|
2001-10-18 23:30:06 +02:00
|
|
|
#include "winbase.h"
|
|
|
|
#include "winuser.h"
|
2000-11-05 21:25:02 +01:00
|
|
|
#include "winerror.h"
|
|
|
|
#include "dinput.h"
|
|
|
|
|
|
|
|
#include "dinput_private.h"
|
|
|
|
#include "device_private.h"
|
2002-03-10 00:29:33 +01:00
|
|
|
#include "wine/debug.h"
|
2000-11-05 21:25:02 +01:00
|
|
|
|
2002-03-10 00:29:33 +01:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(dinput);
|
2000-11-05 21:25:02 +01:00
|
|
|
|
2005-05-30 12:01:08 +02:00
|
|
|
static const IDirectInputDevice8WVtbl SysKeyboardWvt;
|
2021-10-13 09:21:17 +02:00
|
|
|
static const struct dinput_device_vtbl keyboard_internal_vtbl;
|
2002-05-07 03:49:19 +02:00
|
|
|
|
2003-06-16 22:22:13 +02:00
|
|
|
typedef struct SysKeyboardImpl SysKeyboardImpl;
|
|
|
|
struct SysKeyboardImpl
|
2000-11-05 21:25:02 +01:00
|
|
|
{
|
2011-01-03 15:25:07 +01:00
|
|
|
struct IDirectInputDeviceImpl base;
|
2000-11-05 21:25:02 +01:00
|
|
|
};
|
|
|
|
|
2011-01-09 23:43:32 +01:00
|
|
|
static inline SysKeyboardImpl *impl_from_IDirectInputDevice8W(IDirectInputDevice8W *iface)
|
|
|
|
{
|
2011-01-09 23:44:19 +01:00
|
|
|
return CONTAINING_RECORD(CONTAINING_RECORD(iface, IDirectInputDeviceImpl, IDirectInputDevice8W_iface), SysKeyboardImpl, base);
|
2011-01-09 23:43:32 +01:00
|
|
|
}
|
|
|
|
|
2020-04-17 20:35:07 +02:00
|
|
|
static BYTE map_dik_code(DWORD scanCode, DWORD vkCode, DWORD subType, DWORD version)
|
2008-08-06 15:04:36 +02:00
|
|
|
{
|
2020-04-17 20:35:07 +02:00
|
|
|
if (!scanCode && version < 0x0800)
|
2018-04-16 16:30:47 +02:00
|
|
|
scanCode = MapVirtualKeyW(vkCode, MAPVK_VK_TO_VSC);
|
2008-08-06 15:04:36 +02:00
|
|
|
|
2018-08-17 10:15:02 +02:00
|
|
|
if (subType == DIDEVTYPEKEYBOARD_JAPAN106)
|
|
|
|
{
|
|
|
|
switch (scanCode)
|
|
|
|
{
|
|
|
|
case 0x0d: /* ^ */
|
|
|
|
scanCode = DIK_CIRCUMFLEX;
|
|
|
|
break;
|
|
|
|
case 0x1a: /* @ */
|
|
|
|
scanCode = DIK_AT;
|
|
|
|
break;
|
|
|
|
case 0x1b: /* [ */
|
|
|
|
scanCode = DIK_LBRACKET;
|
|
|
|
break;
|
|
|
|
case 0x28: /* : */
|
|
|
|
scanCode = DIK_COLON;
|
|
|
|
break;
|
|
|
|
case 0x29: /* Hankaku/Zenkaku */
|
|
|
|
scanCode = DIK_KANJI;
|
|
|
|
break;
|
|
|
|
case 0x2b: /* ] */
|
|
|
|
scanCode = DIK_RBRACKET;
|
|
|
|
break;
|
|
|
|
case 0x73: /* \ */
|
|
|
|
scanCode = DIK_BACKSLASH;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2021-10-21 18:07:46 +02:00
|
|
|
if (scanCode & 0x100) scanCode |= 0x80;
|
|
|
|
return (BYTE)scanCode;
|
2008-08-06 15:04:36 +02:00
|
|
|
}
|
|
|
|
|
2021-05-25 18:48:53 +02:00
|
|
|
int dinput_keyboard_hook( IDirectInputDevice8W *iface, WPARAM wparam, LPARAM lparam )
|
2002-05-20 00:26:16 +02:00
|
|
|
{
|
2021-05-25 18:48:53 +02:00
|
|
|
SysKeyboardImpl *This = impl_from_IDirectInputDevice8W( iface );
|
2021-10-13 09:21:12 +02:00
|
|
|
BYTE new_diks, subtype = GET_DIDEVICE_SUBTYPE( This->base.instance.dwDevType );
|
2009-02-21 20:54:37 +01:00
|
|
|
int dik_code, ret = This->base.dwCoopLevel & DISCL_EXCLUSIVE;
|
2006-03-18 19:26:37 +01:00
|
|
|
KBDLLHOOKSTRUCT *hook = (KBDLLHOOKSTRUCT *)lparam;
|
2021-10-21 18:07:46 +02:00
|
|
|
DWORD scan_code;
|
2005-03-24 16:08:27 +01:00
|
|
|
|
2007-07-07 07:36:30 +02:00
|
|
|
if (wparam != WM_KEYDOWN && wparam != WM_KEYUP &&
|
|
|
|
wparam != WM_SYSKEYDOWN && wparam != WM_SYSKEYUP)
|
2009-02-21 20:54:37 +01:00
|
|
|
return 0;
|
2007-07-07 07:36:30 +02:00
|
|
|
|
2018-04-16 16:30:53 +02:00
|
|
|
TRACE("(%p) wp %08lx, lp %08lx, vk %02x, scan %02x\n",
|
|
|
|
iface, wparam, lparam, hook->vkCode, hook->scanCode);
|
2002-08-07 01:49:12 +02:00
|
|
|
|
2009-02-27 17:20:08 +01:00
|
|
|
switch (hook->vkCode)
|
|
|
|
{
|
|
|
|
/* R-Shift is special - it is an extended key with separate scan code */
|
|
|
|
case VK_RSHIFT : dik_code = DIK_RSHIFT; break;
|
|
|
|
case VK_PAUSE : dik_code = DIK_PAUSE; break;
|
|
|
|
case VK_NUMLOCK : dik_code = DIK_NUMLOCK; break;
|
|
|
|
case VK_SUBTRACT: dik_code = DIK_SUBTRACT; break;
|
|
|
|
default:
|
2021-10-21 18:07:46 +02:00
|
|
|
scan_code = hook->scanCode & 0xff;
|
|
|
|
if (hook->flags & LLKHF_EXTENDED) scan_code |= 0x100;
|
|
|
|
dik_code = map_dik_code( scan_code, hook->vkCode, subtype, This->base.dinput->dwVersion );
|
2009-02-27 17:20:08 +01:00
|
|
|
}
|
2006-07-27 16:19:59 +02:00
|
|
|
new_diks = hook->flags & LLKHF_UP ? 0 : 0x80;
|
|
|
|
|
|
|
|
/* returns now if key event already known */
|
2021-10-19 09:20:05 +02:00
|
|
|
if (new_diks == This->base.device_state[dik_code]) return ret;
|
2005-03-24 16:08:27 +01:00
|
|
|
|
2021-10-19 09:20:05 +02:00
|
|
|
This->base.device_state[dik_code] = new_diks;
|
|
|
|
TRACE( " setting key %02x to %02x\n", dik_code, This->base.device_state[dik_code] );
|
2009-02-21 20:54:37 +01:00
|
|
|
|
2006-12-01 18:56:00 +01:00
|
|
|
EnterCriticalSection(&This->base.crit);
|
2011-01-09 23:43:17 +01:00
|
|
|
queue_event(iface, DIDFT_MAKEINSTANCE(dik_code) | DIDFT_PSHBUTTON,
|
2013-12-11 01:45:28 +01:00
|
|
|
new_diks, GetCurrentTime(), This->base.dinput->evsequence++);
|
2021-09-17 09:06:22 +02:00
|
|
|
if (This->base.hEvent) SetEvent( This->base.hEvent );
|
2006-12-01 18:56:00 +01:00
|
|
|
LeaveCriticalSection(&This->base.crit);
|
2009-02-21 20:54:37 +01:00
|
|
|
|
|
|
|
return ret;
|
2002-05-20 00:26:16 +02:00
|
|
|
}
|
2002-05-07 03:49:19 +02:00
|
|
|
|
2018-08-17 10:14:54 +02:00
|
|
|
static DWORD get_keyboard_subtype(void)
|
|
|
|
{
|
|
|
|
DWORD kbd_type, kbd_subtype, dev_subtype;
|
|
|
|
kbd_type = GetKeyboardType(0);
|
|
|
|
kbd_subtype = GetKeyboardType(1);
|
|
|
|
|
|
|
|
if (kbd_type == 4 || (kbd_type == 7 && kbd_subtype == 0))
|
|
|
|
dev_subtype = DIDEVTYPEKEYBOARD_PCENH;
|
|
|
|
else if (kbd_type == 7 && kbd_subtype == 2)
|
|
|
|
dev_subtype = DIDEVTYPEKEYBOARD_JAPAN106;
|
|
|
|
else {
|
|
|
|
FIXME("Unknown keyboard type=%u, subtype=%u\n", kbd_type, kbd_subtype);
|
|
|
|
dev_subtype = DIDEVTYPEKEYBOARD_PCENH;
|
|
|
|
}
|
|
|
|
return dev_subtype;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void fill_keyboard_dideviceinstanceW(LPDIDEVICEINSTANCEW lpddi, DWORD version, DWORD subtype) {
|
2003-06-16 22:22:13 +02:00
|
|
|
DWORD dwSize;
|
|
|
|
DIDEVICEINSTANCEW ddi;
|
|
|
|
|
|
|
|
dwSize = lpddi->dwSize;
|
|
|
|
|
2006-10-08 01:55:40 +02:00
|
|
|
TRACE("%d %p\n", dwSize, lpddi);
|
2003-06-16 22:22:13 +02:00
|
|
|
|
|
|
|
memset(lpddi, 0, dwSize);
|
|
|
|
memset(&ddi, 0, sizeof(ddi));
|
|
|
|
|
|
|
|
ddi.dwSize = dwSize;
|
|
|
|
ddi.guidInstance = GUID_SysKeyboard;/* DInput's GUID */
|
2018-10-31 11:01:41 +01:00
|
|
|
ddi.guidProduct = GUID_SysKeyboard;
|
2005-05-16 10:44:14 +02:00
|
|
|
if (version >= 0x0800)
|
2018-08-17 10:14:54 +02:00
|
|
|
ddi.dwDevType = DI8DEVTYPE_KEYBOARD | (subtype << 8);
|
2003-06-16 22:22:13 +02:00
|
|
|
else
|
2018-08-17 10:14:54 +02:00
|
|
|
ddi.dwDevType = DIDEVTYPE_KEYBOARD | (subtype << 8);
|
2003-06-16 22:22:13 +02:00
|
|
|
MultiByteToWideChar(CP_ACP, 0, "Keyboard", -1, ddi.tszInstanceName, MAX_PATH);
|
|
|
|
MultiByteToWideChar(CP_ACP, 0, "Wine Keyboard", -1, ddi.tszProductName, MAX_PATH);
|
|
|
|
|
|
|
|
memcpy(lpddi, &ddi, (dwSize < sizeof(ddi) ? dwSize : sizeof(ddi)));
|
|
|
|
}
|
|
|
|
|
2021-05-31 10:23:56 +02:00
|
|
|
static HRESULT keyboarddev_enum_device(DWORD dwDevType, DWORD dwFlags, LPDIDEVICEINSTANCEW lpddi, DWORD version, int id)
|
2000-11-05 21:25:02 +01:00
|
|
|
{
|
2004-09-13 21:16:47 +02:00
|
|
|
if (id != 0)
|
2013-05-20 21:10:02 +02:00
|
|
|
return E_FAIL;
|
2004-09-13 21:16:47 +02:00
|
|
|
|
2019-04-26 03:09:56 +02:00
|
|
|
if (dwFlags & DIEDFL_FORCEFEEDBACK)
|
|
|
|
return S_FALSE;
|
|
|
|
|
2003-06-13 20:55:41 +02:00
|
|
|
if ((dwDevType == 0) ||
|
2005-05-16 10:44:14 +02:00
|
|
|
((dwDevType == DIDEVTYPE_KEYBOARD) && (version < 0x0800)) ||
|
|
|
|
(((dwDevType == DI8DEVCLASS_KEYBOARD) || (dwDevType == DI8DEVTYPE_KEYBOARD)) && (version >= 0x0800))) {
|
2000-11-05 21:25:02 +01:00
|
|
|
TRACE("Enumerating the Keyboard device\n");
|
2002-06-01 01:06:46 +02:00
|
|
|
|
2018-08-17 10:14:54 +02:00
|
|
|
fill_keyboard_dideviceinstanceW(lpddi, version, get_keyboard_subtype());
|
2003-02-24 21:41:28 +01:00
|
|
|
|
2013-05-20 21:10:02 +02:00
|
|
|
return S_OK;
|
2000-11-05 21:25:02 +01:00
|
|
|
}
|
|
|
|
|
2013-05-20 21:10:02 +02:00
|
|
|
return S_FALSE;
|
2000-11-05 21:25:02 +01:00
|
|
|
}
|
|
|
|
|
2021-05-28 11:41:26 +02:00
|
|
|
static HRESULT alloc_device( REFGUID rguid, IDirectInputImpl *dinput, SysKeyboardImpl **out )
|
2000-11-05 21:25:02 +01:00
|
|
|
{
|
2021-10-13 09:21:12 +02:00
|
|
|
BYTE subtype = get_keyboard_subtype();
|
2003-06-16 22:22:13 +02:00
|
|
|
SysKeyboardImpl* newDevice;
|
2021-05-28 11:41:27 +02:00
|
|
|
HRESULT hr;
|
2005-03-24 16:08:27 +01:00
|
|
|
|
2021-10-13 09:21:17 +02:00
|
|
|
if (FAILED(hr = direct_input_device_alloc( sizeof(SysKeyboardImpl), &SysKeyboardWvt, &keyboard_internal_vtbl,
|
|
|
|
rguid, dinput, (void **)&newDevice )))
|
2021-05-28 11:41:27 +02:00
|
|
|
return hr;
|
2007-03-08 16:32:50 +01:00
|
|
|
newDevice->base.crit.DebugInfo->Spare[0] = (DWORD_PTR)(__FILE__ ": SysKeyboardImpl*->base.crit");
|
2021-05-28 11:41:27 +02:00
|
|
|
|
2021-10-13 09:21:12 +02:00
|
|
|
fill_keyboard_dideviceinstanceW( &newDevice->base.instance, newDevice->base.dinput->dwVersion, subtype );
|
2021-10-13 09:21:13 +02:00
|
|
|
newDevice->base.caps.dwDevType = newDevice->base.instance.dwDevType;
|
|
|
|
newDevice->base.caps.dwFirmwareRevision = 100;
|
|
|
|
newDevice->base.caps.dwHardwareRevision = 100;
|
2000-11-05 21:25:02 +01:00
|
|
|
|
2021-10-18 10:21:55 +02:00
|
|
|
if (FAILED(hr = direct_input_device_init( &newDevice->base.IDirectInputDevice8W_iface )))
|
2006-12-22 18:54:29 +01:00
|
|
|
{
|
2021-10-18 10:21:55 +02:00
|
|
|
IDirectInputDevice_Release( &newDevice->base.IDirectInputDevice8W_iface );
|
|
|
|
return hr;
|
2006-12-22 18:54:29 +01:00
|
|
|
}
|
|
|
|
|
2021-05-28 11:41:26 +02:00
|
|
|
*out = newDevice;
|
|
|
|
return DI_OK;
|
2000-11-05 21:25:02 +01:00
|
|
|
}
|
|
|
|
|
2021-05-31 10:23:55 +02:00
|
|
|
static HRESULT keyboarddev_create_device( IDirectInputImpl *dinput, REFGUID rguid, IDirectInputDevice8W **out )
|
2000-11-05 21:25:02 +01:00
|
|
|
{
|
2021-05-31 10:23:55 +02:00
|
|
|
TRACE( "%p %s %p\n", dinput, debugstr_guid( rguid ), out );
|
|
|
|
*out = NULL;
|
2000-11-05 21:25:02 +01:00
|
|
|
|
2018-10-31 11:01:41 +01:00
|
|
|
if (IsEqualGUID(&GUID_SysKeyboard, rguid)) /* Wine Keyboard */
|
2011-01-23 20:44:20 +01:00
|
|
|
{
|
|
|
|
SysKeyboardImpl *This;
|
2021-05-28 11:41:26 +02:00
|
|
|
HRESULT hr;
|
2011-01-23 20:44:20 +01:00
|
|
|
|
2021-05-28 11:41:26 +02:00
|
|
|
if (FAILED(hr = alloc_device( rguid, dinput, &This ))) return hr;
|
2011-01-23 20:44:20 +01:00
|
|
|
|
2021-05-28 11:41:26 +02:00
|
|
|
TRACE( "Created a Keyboard device (%p)\n", This );
|
2011-01-23 20:44:20 +01:00
|
|
|
|
2021-05-31 10:23:55 +02:00
|
|
|
*out = &This->base.IDirectInputDevice8W_iface;
|
2011-01-23 20:44:20 +01:00
|
|
|
return DI_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
return DIERR_DEVICENOTREG;
|
2000-11-05 21:25:02 +01:00
|
|
|
}
|
|
|
|
|
2005-03-15 20:36:15 +01:00
|
|
|
const struct dinput_device keyboard_device = {
|
2004-06-04 20:06:37 +02:00
|
|
|
"Wine keyboard driver",
|
2021-05-31 10:23:56 +02:00
|
|
|
keyboarddev_enum_device,
|
2011-01-23 20:44:20 +01:00
|
|
|
keyboarddev_create_device
|
2000-11-05 21:25:02 +01:00
|
|
|
};
|
|
|
|
|
2021-10-20 11:29:30 +02:00
|
|
|
static HRESULT keyboard_internal_poll( IDirectInputDevice8W *iface )
|
|
|
|
{
|
|
|
|
check_dinput_events();
|
|
|
|
return DI_OK;
|
|
|
|
}
|
|
|
|
|
2021-10-13 09:21:17 +02:00
|
|
|
static HRESULT keyboard_internal_acquire( IDirectInputDevice8W *iface )
|
2015-04-11 10:06:05 +02:00
|
|
|
{
|
2021-10-13 09:21:17 +02:00
|
|
|
return DI_OK;
|
|
|
|
}
|
2015-04-11 10:06:05 +02:00
|
|
|
|
2021-10-13 09:21:17 +02:00
|
|
|
static HRESULT keyboard_internal_unacquire( IDirectInputDevice8W *iface )
|
|
|
|
{
|
|
|
|
SysKeyboardImpl *This = impl_from_IDirectInputDevice8W( iface );
|
2021-10-19 09:20:05 +02:00
|
|
|
memset( This->base.device_state, 0, sizeof(This->base.device_state) );
|
2021-10-13 09:21:17 +02:00
|
|
|
return DI_OK;
|
2015-04-11 10:06:05 +02:00
|
|
|
}
|
|
|
|
|
2021-10-18 10:21:55 +02:00
|
|
|
static BOOL try_enum_object( const DIPROPHEADER *filter, DWORD flags, LPDIENUMDEVICEOBJECTSCALLBACKW callback,
|
|
|
|
DIDEVICEOBJECTINSTANCEW *instance, void *data )
|
|
|
|
{
|
|
|
|
if (flags != DIDFT_ALL && !(flags & DIDFT_GETTYPE( instance->dwType ))) return DIENUM_CONTINUE;
|
|
|
|
|
|
|
|
switch (filter->dwHow)
|
|
|
|
{
|
|
|
|
case DIPH_DEVICE:
|
|
|
|
return callback( instance, data );
|
|
|
|
case DIPH_BYOFFSET:
|
|
|
|
if (filter->dwObj != instance->dwOfs) return DIENUM_CONTINUE;
|
|
|
|
return callback( instance, data );
|
|
|
|
case DIPH_BYID:
|
|
|
|
if ((filter->dwObj & 0x00ffffff) != (instance->dwType & 0x00ffffff)) return DIENUM_CONTINUE;
|
|
|
|
return callback( instance, data );
|
|
|
|
}
|
|
|
|
|
|
|
|
return DIENUM_CONTINUE;
|
|
|
|
}
|
|
|
|
|
2021-10-20 11:29:29 +02:00
|
|
|
static HRESULT keyboard_internal_enum_objects( IDirectInputDevice8W *iface, const DIPROPHEADER *filter, DWORD flags,
|
2021-10-18 10:21:55 +02:00
|
|
|
LPDIENUMDEVICEOBJECTSCALLBACKW callback, void *context )
|
|
|
|
{
|
|
|
|
SysKeyboardImpl *impl = impl_from_IDirectInputDevice8W( iface );
|
|
|
|
BYTE subtype = GET_DIDEVICE_SUBTYPE( impl->base.instance.dwDevType );
|
|
|
|
DIDEVICEOBJECTINSTANCEW instance =
|
|
|
|
{
|
|
|
|
.dwSize = sizeof(DIDEVICEOBJECTINSTANCEW),
|
|
|
|
.guidType = GUID_Key,
|
|
|
|
.dwOfs = DIK_ESCAPE,
|
|
|
|
.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( DIK_ESCAPE ),
|
|
|
|
};
|
|
|
|
DWORD i, dik;
|
|
|
|
BOOL ret;
|
|
|
|
|
|
|
|
for (i = 0; i < 512; ++i)
|
|
|
|
{
|
|
|
|
if (!GetKeyNameTextW( i << 16, instance.tszName, ARRAY_SIZE(instance.tszName) )) continue;
|
|
|
|
if (!(dik = map_dik_code( i, 0, subtype, impl->base.dinput->dwVersion ))) continue;
|
|
|
|
instance.dwOfs = dik;
|
|
|
|
instance.dwType = DIDFT_PSHBUTTON | DIDFT_MAKEINSTANCE( dik );
|
2021-10-20 11:29:29 +02:00
|
|
|
ret = try_enum_object( filter, flags, callback, &instance, context );
|
2021-10-18 10:21:55 +02:00
|
|
|
if (ret != DIENUM_CONTINUE) return DIENUM_STOP;
|
|
|
|
}
|
|
|
|
|
|
|
|
return DIENUM_CONTINUE;
|
|
|
|
}
|
|
|
|
|
2021-10-19 09:20:02 +02:00
|
|
|
static HRESULT keyboard_internal_get_property( IDirectInputDevice8W *iface, DWORD property, DIPROPHEADER *header,
|
|
|
|
DIDEVICEOBJECTINSTANCEW *instance )
|
|
|
|
{
|
|
|
|
switch (property)
|
|
|
|
{
|
|
|
|
case (DWORD_PTR)DIPROP_KEYNAME:
|
|
|
|
{
|
|
|
|
DIPROPSTRING *value = (DIPROPSTRING *)header;
|
|
|
|
lstrcpynW( value->wsz, instance->tszName, ARRAY_SIZE(value->wsz) );
|
|
|
|
return DI_OK;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return DIERR_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
|
2021-10-19 09:20:06 +02:00
|
|
|
static HRESULT keyboard_internal_set_property( IDirectInputDevice8W *iface, DWORD property, const DIPROPHEADER *header,
|
|
|
|
const DIDEVICEOBJECTINSTANCEW *instance )
|
|
|
|
{
|
|
|
|
return DIERR_UNSUPPORTED;
|
|
|
|
}
|
|
|
|
|
2021-10-13 09:21:17 +02:00
|
|
|
static const struct dinput_device_vtbl keyboard_internal_vtbl =
|
|
|
|
{
|
2021-10-20 11:29:33 +02:00
|
|
|
NULL,
|
2021-10-20 11:29:30 +02:00
|
|
|
keyboard_internal_poll,
|
2021-10-13 09:21:17 +02:00
|
|
|
NULL,
|
|
|
|
keyboard_internal_acquire,
|
|
|
|
keyboard_internal_unacquire,
|
2021-10-18 10:21:55 +02:00
|
|
|
keyboard_internal_enum_objects,
|
2021-10-19 09:20:02 +02:00
|
|
|
keyboard_internal_get_property,
|
2021-10-19 09:20:06 +02:00
|
|
|
keyboard_internal_set_property,
|
2021-10-21 09:53:43 +02:00
|
|
|
NULL,
|
2021-10-21 09:53:45 +02:00
|
|
|
NULL,
|
2021-10-21 09:53:46 +02:00
|
|
|
NULL,
|
2021-10-21 09:53:47 +02:00
|
|
|
NULL,
|
2021-10-13 09:21:17 +02:00
|
|
|
};
|
|
|
|
|
2005-05-30 12:01:08 +02:00
|
|
|
static const IDirectInputDevice8WVtbl SysKeyboardWvt =
|
2003-06-16 22:22:13 +02:00
|
|
|
{
|
2011-01-09 23:43:55 +01:00
|
|
|
IDirectInputDevice2WImpl_QueryInterface,
|
|
|
|
IDirectInputDevice2WImpl_AddRef,
|
|
|
|
IDirectInputDevice2WImpl_Release,
|
2021-10-13 09:21:13 +02:00
|
|
|
IDirectInputDevice2WImpl_GetCapabilities,
|
2011-01-09 23:43:55 +01:00
|
|
|
IDirectInputDevice2WImpl_EnumObjects,
|
2021-10-19 09:20:02 +02:00
|
|
|
IDirectInputDevice2WImpl_GetProperty,
|
2011-01-09 23:43:55 +01:00
|
|
|
IDirectInputDevice2WImpl_SetProperty,
|
2021-10-13 09:21:17 +02:00
|
|
|
IDirectInputDevice2WImpl_Acquire,
|
2011-01-09 23:43:55 +01:00
|
|
|
IDirectInputDevice2WImpl_Unacquire,
|
2021-10-20 11:29:32 +02:00
|
|
|
IDirectInputDevice2WImpl_GetDeviceState,
|
2011-01-09 23:43:55 +01:00
|
|
|
IDirectInputDevice2WImpl_GetDeviceData,
|
|
|
|
IDirectInputDevice2WImpl_SetDataFormat,
|
|
|
|
IDirectInputDevice2WImpl_SetEventNotification,
|
|
|
|
IDirectInputDevice2WImpl_SetCooperativeLevel,
|
2021-10-18 10:21:56 +02:00
|
|
|
IDirectInputDevice2WImpl_GetObjectInfo,
|
2021-10-13 09:21:12 +02:00
|
|
|
IDirectInputDevice2WImpl_GetDeviceInfo,
|
2011-01-09 23:43:55 +01:00
|
|
|
IDirectInputDevice2WImpl_RunControlPanel,
|
|
|
|
IDirectInputDevice2WImpl_Initialize,
|
|
|
|
IDirectInputDevice2WImpl_CreateEffect,
|
|
|
|
IDirectInputDevice2WImpl_EnumEffects,
|
|
|
|
IDirectInputDevice2WImpl_GetEffectInfo,
|
|
|
|
IDirectInputDevice2WImpl_GetForceFeedbackState,
|
|
|
|
IDirectInputDevice2WImpl_SendForceFeedbackCommand,
|
|
|
|
IDirectInputDevice2WImpl_EnumCreatedEffectObjects,
|
|
|
|
IDirectInputDevice2WImpl_Escape,
|
|
|
|
IDirectInputDevice2WImpl_Poll,
|
|
|
|
IDirectInputDevice2WImpl_SendDeviceData,
|
|
|
|
IDirectInputDevice7WImpl_EnumEffectsInFile,
|
|
|
|
IDirectInputDevice7WImpl_WriteEffectToFile,
|
2021-10-13 09:21:14 +02:00
|
|
|
IDirectInputDevice8WImpl_BuildActionMap,
|
2021-10-13 09:21:15 +02:00
|
|
|
IDirectInputDevice8WImpl_SetActionMap,
|
2011-01-09 23:43:55 +01:00
|
|
|
IDirectInputDevice8WImpl_GetImageInfo
|
2003-06-16 22:22:13 +02:00
|
|
|
};
|