1
0
Fork 0
forked from fte/fteqw

in_rawinput_keyboard should be functional now.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/branches/wip@3601 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2010-08-24 02:18:42 +00:00
parent b140dac79c
commit 8cac55a8eb
2 changed files with 18 additions and 6 deletions

View file

@ -278,6 +278,8 @@ cvar_t in_rawinput_rdp = SCVAR("in_rawinput_rdp", "0");
void IN_RawInput_MouseDeRegister(void); void IN_RawInput_MouseDeRegister(void);
int IN_RawInput_MouseRegister(void); int IN_RawInput_MouseRegister(void);
void IN_RawInput_KeyboardDeRegister(void);
int IN_RawInput_KeyboardRegister(void);
void IN_RawInput_DeInit(void); void IN_RawInput_DeInit(void);
#endif #endif
@ -396,11 +398,20 @@ static void IN_ActivateMouse (void)
#ifdef USINGRAWINPUT #ifdef USINGRAWINPUT
if (rawmicecount > 0) if (rawmicecount > 0)
{ {
if (IN_RawInput_MouseRegister()) { if (IN_RawInput_MouseRegister())
{
Con_SafePrintf("Raw input: unable to register raw input for mice, deinitializing\n"); Con_SafePrintf("Raw input: unable to register raw input for mice, deinitializing\n");
IN_RawInput_MouseDeRegister(); IN_RawInput_MouseDeRegister();
} }
} }
if (rawkbdcount > 0)
{
if (IN_RawInput_KeyboardRegister())
{
Con_SafePrintf("Raw input: unable to register raw input for keyboard, deinitializing\n");
IN_RawInput_KeyboardDeRegister();
}
}
#endif #endif
if (mouseparmsvalid) if (mouseparmsvalid)
@ -818,7 +829,7 @@ int IN_RawInput_KeyboardRegister(void)
RAWINPUTDEVICE Rid; RAWINPUTDEVICE Rid;
Rid.usUsagePage = 0x01; Rid.usUsagePage = 0x01;
Rid.usUsage = 0x00; Rid.usUsage = 0x06;
Rid.dwFlags = RIDEV_NOLEGACY | RIDEV_APPKEYS | RIDEV_NOHOTKEYS; // fetch everything, disable hotkey behavior (should cvar?) Rid.dwFlags = RIDEV_NOLEGACY | RIDEV_APPKEYS | RIDEV_NOHOTKEYS; // fetch everything, disable hotkey behavior (should cvar?)
Rid.hwndTarget = NULL; Rid.hwndTarget = NULL;
@ -979,6 +990,7 @@ void IN_RawInput_Init(void)
continue; continue;
rawkbd[rawkbdcount].handles.rawinputhandle = pRawInputDeviceList[i].hDevice; rawkbd[rawkbdcount].handles.rawinputhandle = pRawInputDeviceList[i].hDevice;
rawkbd[rawkbdcount].playerid = rawmicecount;
rawkbdcount++; rawkbdcount++;
break; break;
default: default:
@ -1751,8 +1763,8 @@ void IN_RawInput_KeyboardRead(void)
return; return;
down = !(raw->data.keyboard.Flags & RI_KEY_BREAK); down = !(raw->data.keyboard.Flags & RI_KEY_BREAK);
wParam = raw->data.keyboard.VKey; wParam = (-down) & 0xC0000000;
lParam = (-down) & 0xC0000000; lParam = MapVirtualKey(raw->data.keyboard.VKey, 0)<<16;
pnum = cl.splitclients; pnum = cl.splitclients;
if (pnum < 1) if (pnum < 1)

View file

@ -1643,7 +1643,7 @@ void Key_Event (int pnum, int key, unsigned int unicode, qboolean down)
} }
else else
{ {
sprintf (cmd, "+p%i %s\n", pnum+1, kb+1, key+oldstate*256); sprintf (cmd, "p%i %s\n", pnum+1, kb, key+oldstate*256);
Cbuf_AddText (cmd, bindcmdlevel[key][keystate]); Cbuf_AddText (cmd, bindcmdlevel[key][keystate]);
} }
} }