View previous topic :: View next topic |
Author |
Message |
joelcnz
Joined: 23 Feb 2009 Posts: 76
|
Posted: Sat Mar 07, 2009 12:52 am Post subject: The escape key (key[KEY_ESC]) |
|
|
Up until recently I haven't had a problem with it. It now works at the launch of my program but stops working though it works after hitting another key. |
|
Back to top |
|
|
michaelp
Joined: 27 Jul 2008 Posts: 114
|
Posted: Sat Mar 07, 2009 4:36 pm Post subject: |
|
|
What do you mean by that?
Mind posting some code to demonstrate what you mean? |
|
Back to top |
|
|
joelcnz
Joined: 23 Feb 2009 Posts: 76
|
Posted: Sat Mar 07, 2009 7:04 pm Post subject: |
|
|
while( ! key[KEY_ESC] ) {
...
}
or
bool done=false;
While ( ! done ) {
if ( key[KEY_ESC] ) {
done=true;
}
} |
|
Back to top |
|
|
torhu
Joined: 30 Mar 2006 Posts: 56
|
Posted: Thu Mar 19, 2009 2:50 pm Post subject: |
|
|
Are you sure it doesn't just stop somewhere inside the loop? |
|
Back to top |
|
|
joelcnz
Joined: 23 Feb 2009 Posts: 76
|
Posted: Tue Apr 21, 2009 12:59 am Post subject: |
|
|
The program runs alright though, it wouldn't if it would get stuck. |
|
Back to top |
|
|
torhu
Joined: 30 Mar 2006 Posts: 56
|
Posted: Wed Apr 22, 2009 12:15 pm Post subject: |
|
|
It's hard to tell what's going on without seeing some more code. Maybe you could post the whole thing if it's not too big? |
|
Back to top |
|
|
joelcnz
Joined: 23 Feb 2009 Posts: 76
|
Posted: Thu Apr 23, 2009 7:21 pm Post subject: |
|
|
This is a message, please ignore it.
Last edited by joelcnz on Thu Apr 23, 2009 7:32 pm; edited 1 time in total |
|
Back to top |
|
|
joelcnz
Joined: 23 Feb 2009 Posts: 76
|
Posted: Thu Apr 23, 2009 7:24 pm Post subject: |
|
|
I dunno. I can't seem to get not exit when I hit the escape key, at the moment. Maybe it's just my computer. |
|
Back to top |
|
|
torhu
Joined: 30 Mar 2006 Posts: 56
|
Posted: Fri Apr 24, 2009 9:16 am Post subject: |
|
|
See if the examples that use KEY_ESC work. If they do, you're doing something wrong. |
|
Back to top |
|
|
joelcnz
Joined: 23 Feb 2009 Posts: 76
|
Posted: Fri Jun 12, 2009 9:41 pm Post subject: key pressing, old program, 320x200 resolution |
|
|
I've found an old allegro program has trouble with keys working too. So I think it might be my OS Vista or some thing. In my game the guy is supposed to go faster when you hold down the shift key but he only goes faster a bit. Found also (I have a second keyboard hooked up) my laptop shift key works better than my external keyboards shift key, (in my old program).
Another thing 320x200 resolution is a mess on my wide screened laptop. And changing to low res full screen resizes some of the windows. |
|
Back to top |
|
|
torhu
Joined: 30 Mar 2006 Posts: 56
|
Posted: Sat Jun 13, 2009 10:35 am Post subject: |
|
|
I don't know if Vista can cause trouble, I still use XP. You could try asking over at the Allegro forum. I don't have widescreen either. Sorry that I can't be of much help. |
|
Back to top |
|
|
|