Hello Guest

Keyboard not responding since update to 1.0 beta3

  • 34 Replies
  • 17203 Views
*

Offline Nop

  • *
  • 43
Keyboard not responding since update to 1.0 beta3
« on: September 11, 2006, 11:22:07 »
Hello!

I have upgraded a game client to the libs V1.0beta 3. The game has been running smoothly on V0.98 for about a year. Now a problem has occurred for about 3 out of maybe 100 users that the application no longer responds to the keyboard. To be exact, typed text is no longer accepted.

Question: Was there a major chane in the way keyboard input is processed?

*

Offline Matzon

  • *****
  • 2242
Keyboard not responding since update to 1.0 beta3
« Reply #1 on: September 11, 2006, 11:46:54 »
since 0.98 there has been some input changes.
How are you using the keyboard ?

*

Offline Nop

  • *
  • 43
Keyboard not responding since update to 1.0 beta3
« Reply #2 on: September 11, 2006, 15:00:30 »
The keyboard is polled about 20 times per second by the following code:

Code: [Select]
     
        Keyboard.next();

        int key = Keyboard.getEventKey();
        // react only to pressed keys
        if( Keyboard.getEventKeyState() )
        {
            // still holding the same old key
            if( lastKeyDown == key
                && System.currentTimeMillis() < lastKeyTime )
            {
                return;
            }
            lastKeyDown = key;
            lastKeyTime = Long.MAX_VALUE;
         switch( key )
            {
                case Keyboard.KEY_F12:
                    Game.getPeople().toggleNameMode();
                    break;
...


For those people experiencing the problem, the switch() is never called. For most people it works fine.

Before this code, there is a call to
Code: [Select]
Keyboard.isKeyDown( Keyyboard.KEY_ESCAPE ) ) for quitting the application. That always seems to work.

*

Offline Nop

  • *
  • 43
Keyboard not responding since update to 1.0 beta3
« Reply #3 on: September 26, 2006, 16:42:44 »
* BUMP *

Has anybody any idea what the problem might be?

Anything wrong with the way I am calling those methods?

We still have the problem, that keyboard works for most users, but for some their input is ingored.

*

Offline kappa

  • *****
  • 1315
Keyboard not responding since update to 1.0 beta3
« Reply #4 on: September 27, 2006, 00:18:22 »
Keyboard seems to work fine for me, heres some code on how it do it might help.

Code: [Select]
if (Keyboard.next()) {
            switch (Keyboard.getEventKey()) {
                                 
                case Keyboard.KEY_E:
                    if (Keyboard.getEventKeyState()) {
                       
                        emboss = !emboss;
                    }
                    break;
                   
                case Keyboard.KEY_M:
                    if (Keyboard.getEventKeyState()) {
                       
                        useMultitexture = ((!useMultitexture) && multitextureSupported);
                    }
                    break;
                   
                case Keyboard.KEY_B:
                    if (Keyboard.getEventKeyState()) {
                       
                        bumps = !bumps;
                    }
                    break;
                   
                case Keyboard.KEY_F:
                    if (Keyboard.getEventKeyState()) {
                       
                        filter++;
                        filter%=3;
                    }
                    break;
            }
        }

*

Offline Nop

  • *
  • 43
Keyboard not responding since update to 1.0 beta3
« Reply #5 on: October 07, 2006, 12:20:00 »
It appears that all users with the problem are using Windows 98.

Has anybody observed any problems with that version and LWJGL?

*

Offline Matzon

  • *****
  • 2242
Keyboard not responding since update to 1.0 beta3
« Reply #6 on: October 07, 2006, 12:38:31 »
I haven't. Unfortunately I dont have access to a win9x box, so a bit hard to find the cause

*

Offline Nop

  • *
  • 43
Keyboard not responding since update to 1.0 beta3
« Reply #7 on: October 08, 2006, 01:18:17 »
Clarification. I have learned that we have 7 users with this problem and all of them seem to have Windows 98 SE. The regular Win98 seems to work.

Also, the problem seems to be with regular keys. F-Keys and Enter do work, just all regularly typed keys are not coming through. This looks like it was not a problem with my code but with LWJGL under Win98.

Anybody out there who can confirm or disprove this theory?

*

Offline Nop

  • *
  • 43
Keyboard not responding since update to 1.0 beta3
« Reply #8 on: October 11, 2006, 18:44:06 »
I reworked my code a little according to the code sample posted and removed the time-dependent code. But no change, typed letters seem not to work on Windows 98 SE.

*

Offline Matzon

  • *****
  • 2242
Keyboard not responding since update to 1.0 beta3
« Reply #9 on: October 11, 2006, 19:36:53 »
have you tried with debug turned on(http://lwjgl.org/wiki/doku.php/lwjgl/tutorials/usingdebug)?
what version of directx is installed?

*

Offline elias

  • *****
  • 899
    • http://oddlabs.com
Keyboard not responding since update to 1.0 beta3
« Reply #10 on: October 11, 2006, 20:37:21 »
I comitted a possible fix, please test these pre-built libraries (as I have no access to any win9x machines):

http://download.oddlabs.com/elias/lwjgl.jar
http://download.oddlabs.com/elias/lwjgl.dll

 - elias

*

Offline Nop

  • *
  • 43
Keyboard not responding since update to 1.0 beta3
« Reply #11 on: October 13, 2006, 19:59:38 »
Nope, I haven't. I don't have a Win98 SE system either, otherwise I'd provide much better information. :-)

The problem has occurred at 7 of our players machines. It is reproducible there, but due to the nature of an online game I can't get there for debugging.

What was the nature of the changes in keyboard input between 0.98 and 1.0?

*

Offline elias

  • *****
  • 899
    • http://oddlabs.com
Keyboard not responding since update to 1.0 beta3
« Reply #12 on: October 13, 2006, 20:06:29 »
Several changes, but mostly moving stuff from native to java which should be without any side effects, but you never know of course. The fix I comitted was a reversal of the removal of the usage of ToAscii for win9x machines. It seems that the alternative, ToUnicode, was only available for NT based OSes.

 - elias

*

Offline Nop

  • *
  • 43
Keyboard not responding since update to 1.0 beta3
« Reply #13 on: October 14, 2006, 08:51:43 »
Quote from: "elias"
Several changes, but mostly moving stuff from native to java which should be without any side effects, but you never know of course. The fix I comitted was a reversal of the removal of the usage of ToAscii for win9x machines. It seems that the alternative, ToUnicode, was only available for NT based OSes.


Ist it possible that this change is related to the problem? I think there are two circumstances that may be hinting at this:
- only Windows 98 SE machines are concerned
- only letters (which would go through this conversion) are disappearing, enter, function and cursor keys are working

*

Offline elias

  • *****
  • 899
    • http://oddlabs.com
Keyboard not responding since update to 1.0 beta3
« Reply #14 on: October 14, 2006, 14:38:53 »
Hmm, by closer inspection it might not be the problem after all - I see you're not using the translated characters, but raw keys. Then I'm not sure what could cause this - the only bigger change I can recall is the dinput3->dinput8 conversion (with fallback to dinput3 if dinput8 is unavailable). What version of directx are your users running?

 - elias