Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » Allegro 4.2.1 keyboard routine not working after windows 10 update in june

This thread is locked; no one can reply to it. rss feed Print
Allegro 4.2.1 keyboard routine not working after windows 10 update in june
millo666
Member #17,228
December 2019

Hi!

I am using Allegro 4.2.1 with Dev-C++ 5.0.0.0 with Windows 10 for a couple of years and it has worked fine. Strangely after the summer of 2019 the key function won't work properly. If i use key[KEY_R] or any other than key[KEY_ESC] the program won't react immediately, and you have to press that key many times to get it to trig, and sometimes it won't trig at all.

Anyone that has a clue to why this is?

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Allegro 4.2.1 is no longer under development.

The latest version of Allegro 4 released was Allegro 4.4.2.

The latest version in GIT is Allegro 4.4.3.

Update from GIT. Try again.

If that doesn't solve it, you're probably out of luck. :/

Edgar777

EDIT
I should note, I provide a build guide for Allegro443 here :

http://members.allegro.cc/EdgarReynaldo/BuildA4.html

millo666
Member #17,228
December 2019

Thank you very much Edgar.

The thing is though that i am a total noob when it comes to building Allegro. I have only used it under Dev-C++ and would like to do so still. I used 4.2.1 with devpak and Dev-C++ 5.0.0.0 (cause the 4.9.9.2 didn't work under Windows 10).

I tried updating to 4.4.2 using a devpak but i couldn't get it to work. There is no option for Allegro static or ALlegro DLL in that devpak.

Regards, Lars

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

MinGW-W64 GCC 8.1 Posix Dwarf compiler

https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win32/Personal%20Builds/mingw-builds/8.1.0/threads-posix/dwarf/i686-8.1.0-release-posix-dwarf-rt_v6-rev0.7z

Allegro 443 binaries :

https://bitbucket.org/bugsquasher/unofficial-allegro-5-binaries/downloads/A443Deluxe.7z

Ditch DevC++ and devpaks and learn how to use better tools like MinGW-W64 and CodeBlocks. That's the best advice I can give you.

millo666
Member #17,228
December 2019

Thank you Edgar.

I am aware of Dev-C++ but i'm so used to it and i have a C++ course at junior college where i use Dev-C++ with Allegro for simple 2d-graphics and of making 2d-games.

Even if i decide to use Code-Blocks i have no clue how to implement ALlegro into it.

Regards, Lars

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

millo666
Member #17,228
December 2019

No i am not a software developer. I have a basic C++ course and instead of teaching basic C++ in console mode, i wanted to use some graphics and i used allegro with Dev-C++ cause i am used to it.

Also i am not given time as a teacher to learn new things sadly, but i'll have to do it this time. Thank you very much for your help Edgar.

Regards, Lars

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

millo666
Member #17,228
December 2019

I teach only the basics in C++.

bamccaig
Member #7,536
July 2006
avatar

The original problem sounds like a bug in your code, not a bug in Allegro. Things are unlikely to just stop working like that when the code hasn't changed. It's unlikely that Microsoft would break an interface unless Allergro was using a deprecated one. I suggest the op post all of his code.

torhu
Member #2,727
September 2002
avatar

Can you upload an executable for us to test? I think that Allegro 4.x uses DirectInput for keyboard input, and it's possible that noone else does that anymore. But it's also possible that the problem is just something completely different, including somewhere else in your code.

millo666
Member #17,228
December 2019

Thank you guys for replying. It is not a bug in my code as i can test it on a "naked" allegro code, with only the game loop active. I have used Allegro 4.2.1 with Dev-C++ 5.0.0.0 for a couple of years with Windows 10, but after the summer it won't work.

If i change while(key[KEY_ESC] to any other key, the program won't exit.

I will post the code though. Here is an executable where i only changed while(key[KEY_ESC] to while(key[KEY_R] and the program won't exit.

Regards Lars

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

millo666
Member #17,228
December 2019

But that's the thing. You tried pressing "R"? It should then end the program, but it doesn't. Very well i'll put up the core allegro program but it has to be run under 5.0.0.0 Dev-C++ and windows 10 with all updates. When i install windows 10 fresh without updates it works.

torhu
Member #2,727
September 2002
avatar

It does exit if I press for instance Space, then R. But hangs if I press just R. So it's likely to be a logic error in your code.

I'm on the latest Windows 10, not that it should matter.

millo666
Member #17,228
December 2019

You have the source code in my last reply. There's no logic error as you can see there. It's only the Allegro skeleteon code and the while(!key[KEY_ESC]) replaced with (!key[KEY_R]).

Nothing works except ESC.

torhu
Member #2,727
September 2002
avatar

Right. That's odd, can't see any obvious issues with that code. So I guess upgrading Allegro would be an idea...

millo666
Member #17,228
December 2019

Yeah. Strange. I will try to do that.

bamccaig
Member #7,536
July 2006
avatar

You should really be checking return values of every function that can fail. Whether or not you'd see an identifiable error prior to the crash I don't know, but nevertheless your program is sloppy not checking errors. There is a link in my signature to a wiki article that expands upon this.

millo666
Member #17,228
December 2019

Ok, so my source code is sloppy, cause i didn't check for return values? It's like i said before, and like you can see if you download the file, that it is only the Allegro skeleton code with a different key trigger in the game-loop.

If i check for return values i would see if the keyboard routines would initialize, and they do, in some way, but allegro 4.2.1 hasn't changed right, so it has to be something else

I said that i have installed Windows 10 fresh with the same configuration; Dev-C++ 5.0.0.0 with Allegro 4.2.1 and it works flawlessly, but on computers with recently updated Windows 10 it doesn't. So should the logical thing be to think that something has changed in Windows 10 that ha caused this problem or not? That's my thought, and i hoped someone had some solution for it or some thought of might have happened.

Regards, Lars

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

millo666
Member #17,228
December 2019

Ok. Thanks Edgar, then that's it. I will change to 4.4.3.1 like i said earlier. Thanks for all your help, it has really made a difference.

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

millo666
Member #17,228
December 2019

Thank you again, very helpful, i appreciate it so much.

Regards, Lars

Go to: