Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / EscapeKey() is annoying me

Author
Message
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 28th Apr 2003 01:50
Okay, here's what I'd like to do, if at all possible:

- I want to make it that when you press the escape key, my game does not close.
- I want to make it so that if I press the escape key on the story part of the main menu, it will show the main menu.

To do this, I used Disable EscapeKey. Then, when you're on the story section of the main menu I inserted the following code:

If EscapeKey() = 1 Then MenuState = 2 (Takes you back the main menu)

But, it seems that disable escape key also makes it that DBP won't even check input from the escape key.

So here's the question. How can I make it so that if you press escape it DOES NOT close the program, rather it does only what I tell it to do? Thanks
Easily Confused
23
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 28th Apr 2003 01:57 Edited at: 28th Apr 2003 01:58
Strange, Escapekey() still works for me when I use Disable Escapekey.

Try using:

If keystate(1) = 1 then MenuState = 2

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Kangaroo2
23
Years of Service
User Offline
Joined: 26th Sep 2002
Location: United Kingdom
Posted: 28th Apr 2003 02:32
yup the keystate 1 should work. I found under win 98 Disable Escape key ignores it completely, whilst in xp it works fine

Coming Soon! Kangaroo2 Studio... wait and quiver with anticipation! lol
[email protected] - http://www.kangaroo2.com - If the apocalypse comes, email me
HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 28th Apr 2003 05:37
No such luck...what the fudge is up with this?!?!

HZence
23
Years of Service
User Offline
Joined: 9th Mar 2003
Location:
Posted: 28th Apr 2003 05:39
Okay nevermind I just figured it out...go figure

Nilrem
23
Years of Service
User Offline
Joined: 27th Feb 2003
Location: United Kingdom
Posted: 28th Apr 2003 13:04
What did you figure out? (I follow most threads like these, whilst not using or implimenting them as of such yet, I like to see the answer, thinking, logic etc).

I hear and I forget. I see and I remember. I do and I understand.

Login to post a reply

Server time is: 2026-07-10 19:47:54
Your offset time is: 2026-07-10 19:47:54