ESC in a console application

  • Thread starter Thread starter Darin
  • Start date Start date
D

Darin

How can I get the ESC key to work in a console application?

I have:

i=console.read
if i=27 then
{exit my code}
end if

But, when I hit the ESC key nothing happens. How can I get it to work?
My windows application uses ESC to exit forms, and I want this to also
use ESC.

Thanks in advance.

Darin
 
private void keyHandler(Object sender, KeyEventArgs e) {
if ( e.KeyCode == Keys.Escape )
}
 
Hello,

Benny Mathew said:
private void keyHandler(Object sender, KeyEventArgs e) {
if ( e.KeyCode == Keys.Escape )
}

In a *console* application?

Regards,
Herfried K. Wagner
 
How can I get the ESC key to work in a console application?

I have:

i=console.read
if i=27 then
{exit my code}
end if

But, when I hit the ESC key nothing happens. How can I get it to work?
My windows application uses ESC to exit forms, and I want this to also
use ESC.

The default console mode is line input -- you won't get data until the
ENTER key is pressed. Maybe if you switch to character mode you'd get
the behavior you're looking for. See:

http://groups.google.com/groups?selm=#dVRo$mRBHA.2132@tkmsftngp05
 
Back
Top