Keyboard not responding since update to 1.0 beta3

Started by Nop, September 11, 2006, 11:22:07

Previous topic - Next topic

Nop

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?

Matzon

since 0.98 there has been some input changes.
How are you using the keyboard ?

Nop

The keyboard is polled about 20 times per second by the following code:

      
        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
Keyboard.isKeyDown( Keyyboard.KEY_ESCAPE ) )
for quitting the application. That always seems to work.

Nop

* 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.

kappa

Keyboard seems to work fine for me, heres some code on how it do it might help.

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;
            }
        }

Nop

It appears that all users with the problem are using Windows 98.

Has anybody observed any problems with that version and LWJGL?

Matzon

I haven't. Unfortunately I dont have access to a win9x box, so a bit hard to find the cause

Nop

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?

Nop

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.

Matzon


elias

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

Nop

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?

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.

- elias

Nop

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

elias

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