Game Development Community

Keyboard unaquired / aquired

by James Ford · in Torque Game Builder · 06/04/2006 (1:54 pm) · 8 replies

When I hit tilde to bring down the console, sometimes it will flash down and then back up. Then after doing this a few times, when I get the console down I see this message:

keyboard unaquired
keyboard aquired
repeats..

Whats going on?

#1
06/08/2006 (11:03 am)
Ok, I think that message is probably normal...It just means when you have the consol down the game does not recieve any input from the keyboard, and when the consol is removed it is "aquired" again. But what is not normal is when I hit the tilde key the consol will flash down and back up so I cant actually use the console. Just another problem I was having in BETA3 that I dont seem to be having in SC1 yet.
#2
06/16/2006 (2:04 pm)
Actually its still doing this, quite annoying having to hit tilde 5 times before i can see the console, and i have SC3. Of course this could just be a problem with my keyboard, but I doubt it.

(this should be moved to bugs if admins can do that)
#3
06/16/2006 (4:52 pm)
Are you using the XInput patch ? I noticed the tilde problem starting to appear in TGE 1.4.2 after merging the XInput code. I havent bothered putting any debugging time into it yet, so would be interested if anyone else fixes it ;-)

Stock TGE 1.4.x does not do it, and the input code in stock TGB is probably the same (i say probably because I havent checked) so my thinking is it's a bug/side effect of the XInput code and not TGE/TGB itself. That is, unless you're not using the XInput patch ;-)

T.
#4
06/16/2006 (8:34 pm)
I haven't heard of the Xinput patch, and haven't installed anything except basic t2d, so I would expect not. I should check if this happens when i run any project or just the one im currently working on...
#5
06/17/2006 (4:04 am)
Well, that's interesting then. The XInput patch adds XInput support to the Windows platform layer for XBox 360 gamepads. It was just after I merged that into my game that I started noticing the issue.

It would be helpful if you could check any other copies of T2D you have and see if you can find one it doesnt work on. Any source changes you've made (either yourself or through resources) that touch on the platform code would be helpful to know, too. The platform specific code is all in directories that begin with "platform".

Also let me know what OS you're using - I'm assuming it only happens on Windows, since I havent noticed it happening on the Mac, which would indicate that it's the Windows platform layer that has the bug.

If you are using Windows: Please check if the main window has the WS_SYSMENU style. If it does, the game window will have an icon and a close box (and possibly a minimize box). Note: On XP, there will always be an icon on the taskbar, so you have to look at the actual window. If WS_SYSMENU is being used, open up platformWin32/winWindow.cc (in the source, i forget exact path in T2D) and go to around line 957 ... it's in the CreateOpenGLWindow() function. Change it to look something like this (only one change, highlighted in bold below):

HWND CreateOpenGLWindow( U32 width, U32 height, bool fullScreen )
{
   S32 windowStyle = WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
   S32 exWindowStyle = 0;

   if ( fullScreen )
      windowStyle |= ( WS_POPUP | WS_MAXIMIZE );
   else
      [b]windowStyle |= ( WS_OVERLAPPED | WS_CAPTION );[/b]

   return CreateWindowEx(
      exWindowStyle,
      windowClassName,
      windowName,
      windowStyle,
      0, 0, width, height,
      NULL, NULL,
      winState.appInstance,
      NULL);
}

Rebuild the .exe and see if that makes any difference. It's just a hunch so may not have any effect on the bug, but we might get lucky.

This is one of those things that's a pain in the arse to track down and debug. Now that there's someone else having the issue on a very different codebase to mine, maybe it will make it a bit easier ;-)

T.
#6
06/17/2006 (9:14 am)
I did install drivers for the xbox controller not to long ago, but I assume xinput is a t2d patch not just the drivers.

I have windows xp home

I have made no changes to the source code

When running t2d/tgb it does have minimize/maximize/close icons

I'll try making the change, although I havent rebuilt t2d before (I have all the tools tho)
#7
06/17/2006 (10:26 am)
Do you know/can you find out what version of T2D/TGB it first started appearing in ?

T.
#8
06/17/2006 (8:40 pm)
Ummm, thats a hard question because ive upgraded so many times and worked on this same project since... beta 1 or 2, if thats even version numbers, but I would guess around Beta 3 or 4.

and im kindof busy so i doubt ill be rebuilding t2d for a few days at least