![]() |
|
Keyboard input handling changed from 4.1.18 to 4.2.0 ?? |
tobing
Member #5,213
November 2004
![]() |
I've not posted for some time, but now I have started to put my Allegro game 'The Next Train' from 4.1.18 to 4.2.0, but now there's one little change of behavior I have observed: Keypresses are no longer immediately recognized and cannot be handled properly. This leads to missing key strokes or multiple keypresses if the key is held for a little while. It might be that there's something changed with the thread priorities internally? The application code is unchanged and it's the main loop of my 'Game Framework' project in the depot. Here it is:
|
Evert
Member #794
November 2000
![]() |
What platform? As an aside, mixing key[] and keypressed()/readkey() like that is a bit ugly, and not really how they're meant to be used... |
tobing
Member #5,213
November 2004
![]() |
Windows XP Home SP2, and I'm using the MSVC 2003.NET compiler. Edit: I have changed that to if( scan_code == KEY_ESC ) but there's no change of behavior. Also, I had added alfont 1.9.1, masking 0.80 and lua 5.1.1 to the new version, but didn't use them yet. So I removed the linkage dependencies, again without change of behavior. Edit: Now I have only linked my object files with allegro 4.1.18 import libraries versus allegro 4.2.0 import libraries. Behavior is OK for 4.1.18, but sluggy as described above with 4.2.0. Debugging didn't show me any differences so far... Third and last Edit: Got it. My fault... Some time ago I had requested a change to one structure inside allegro, which was rejected because it can be done using allegro as it is. The problem then was, I couldn't do it that way, so I implemented that change into my 4.1.18. Fine, now as I put the same change into 4.2.0 I didn't make it complete, so that was the reason. Sorry. Ah, Evert, at this place I could avoid using the key[]-array, but not at another place: Scrolling. I want the program to scroll in 8 directions, using the cursor keys, so pressing two of them at the same time and hold them pressed should move the viewport in the desired direction. This will not work with readkey(), or will it? |
Audric
Member #907
January 2001
|
readkey() gets the benefits of "key repetition", but only for one key. That's what the low-level stuff provides directly. If you want a behavior of : |
|