Wrecked Games

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're just that awesome.

Author Topic: strange keyboard bug  (Read 1686 times)

tdev

  • Regular
  • *
  • Karma: +0/-0
  • Posts: 20
    • View Profile
strange keyboard bug
« on: February 26, 2009, 11:40:35 AM »

i am currently experiencing a very strange keyboard bug: OIS gives me the wrong keycodes back for my keyboard. I can use most of the keys normally, but if i try to use
=, i will get keycode 144,
[ is 145,
] is 26,
" is 146, etc
so completely screwed up :-/
EDIT: to say: it wont produce the correct ascii text because of that ...

the keyboard works perfectly with the US layout in windows.

my specs:
windows vista, x86
laptop with british keyboard, but only one language profile: US american
im using recent OIS code (updated some month ago)

do you have any ideas at what level i could start fixing this?
thank you very much

EDIT2: the same code is working perfectly under linux and is giving the correct keycode there :-/
(not on my machine)
« Last Edit: February 26, 2009, 11:59:47 AM by tdev »
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: strange keyboard bug
« Reply #1 on: February 27, 2009, 07:24:53 AM »

Are you seeing this behavior with the console app? Note, keycodes do not always match up with what you expect (based on keyboard layout). However, the translated text value should always be correct. Have you altered the startup params in any way? Are you updating the windows message loop each frame?
Logged

Murphy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 3
    • View Profile
Re: strange keyboard bug
« Reply #2 on: September 22, 2009, 05:03:38 PM »

I am seeing this same problem. Check out a screenshot of the console demo here: http://dl.getdropbox.com/u/1651924/keys.png

As you can see, several keys such as [ and ` are being detected incorrectly. I notice this same behavior in my game. Any idea what this might be?
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: strange keyboard bug
« Reply #3 on: October 03, 2009, 08:09:43 AM »

What is your locale and/or keyboard layout (ie qwerty, azerty, other)?

Are you pumping the message loop? Did you change OIS initialization flags?
Logged

Murphy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 3
    • View Profile
Re: strange keyboard bug
« Reply #4 on: October 04, 2009, 06:03:35 PM »

My artist's computer has this problem while mine doesn't. In fact, most people don't seem to see this problem. We both have qwerty English (United States) locales. I am pumping the message loop and did not change any OIS initialization flags.

This thread seems to mention the same problem but unfortunately no real solution.
Logged

pjcast

  • Administrator
  • Veteran
  • *****
  • Karma: +0/-0
  • Posts: 2653
    • View Profile
    • http://www.wreckedgames.com
Re: strange keyboard bug
« Reply #5 on: October 07, 2009, 07:51:04 PM »

Well, looking at your screenshots appear to be exactly what the original poster complained of. I take it your artist is using Vista?

I wonder if increasing the DirectInput input buffer size (a define within OIS's Win32 code) might fix the issue. Though, these incoming keycodes are generated from DirectInput, so I cannot image what the problem is. I don't exactly have a Vista Dev machine at the moment, would be greatful if you could maybe add some logging to the Win32 classes and see what events are coming in from the buffers. Alternatively, if you could modify your app (or the console app) to use the keyboard in non-buffered mode (will actually use a different code path). You will get no text, but you could at least print out the scan codes to see if they are correct on your artists machine.

I'll try and do some digging about Google/msdn for similar errors as well.
Logged

Murphy

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 3
    • View Profile
Re: strange keyboard bug
« Reply #6 on: October 08, 2009, 11:24:08 AM »

He is actually using Windows 7 where he is having this problem. I am using Vista and don't have the problems.

Thanks for the suggestions. I will be down working with my artist next week so we will run some tests and let you know :)
Logged

qqSBgg

  • Newbie
  • *
  • Karma: +0/-0
  • Posts: 1
    • View Profile
Re: strange keyboard bug
« Reply #7 on: December 29, 2009, 10:25:49 AM »

I am using Windows 7, and I have the same problem.
Logged