Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Escape key


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
6 replies to this topic

#1 Fractal   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 October 2001 - 10:32 AM

how can I get it so that if the user presses ''ESC'' then it will do something. if (cKey == ''//???'') {//do something} Could I be any more dumber? (What do you mean, "No"?)

Sponsor:

#2 Oluseyi   Staff Emeritus   -  Reputation: 1678

Like
Likes
Like

Posted 16 October 2001 - 10:43 AM

Look up WM_KEYDOWN AND VK_*** if it''s for Windows, or getch() and getche() for DOS.

#3 Fractal   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 October 2001 - 10:46 AM

but i need to know what character is needed for ''ESC'' as pressing the esc button when creating the code will not work.

Could I be any more dumber?
(What do you mean, "No"?)


#4 Load Runner   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 October 2001 - 10:49 AM

VK_ESCAPE if its in windows

#5 Fractal   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 October 2001 - 10:53 AM

but what about dos?

Could I be any more dumber?
(What do you mean, "No"?)


#6 Load Runner   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 October 2001 - 10:59 AM

i think ESC is dec 27 in ASCII chart but i could be wrong

Edited by - Load Runner on October 16, 2001 6:00:31 PM

#7 RandomTask   Members   -  Reputation: 122

Like
Likes
Like

Posted 16 October 2001 - 11:51 AM

LoadRunner is right, it is 27 in dec and it is 1B in hex so I''ll use that.

Now all you have to do is what I described in the other post. When you parse the input String do this

  if( inputString[0] == 0x1B )
{
MyProcessEscapeKeyFunction();
}


This is, of course, as long as the escape key shows up in the standard input string, which I''m pretty sure it will do.

RandomTask




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS