How to input a command without pressing enter
Author |
Message |
blankout
|
Posted: Tue Mar 24, 2009 3:14 pm Post subject: How to input a command without pressing enter |
|
|
Is there any way that i can have the user input anything like yes or no, and have the action completed without having to press enter
i.e. as soon as the user presses 'y', the command is input without ever pressing enter |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
DemonWasp
|
Posted: Tue Mar 24, 2009 3:52 pm Post subject: RE:How to input a command without pressing enter |
|
|
Several ways:
get someString : 1
var someChar : char := getchar
getch someChar
Alternately, you could look into Input.KeyDown(). More complex, gives more information, but excessive for a Y/N question. |
|
|
|
|
 |
saltpro15

|
Posted: Tue Mar 24, 2009 5:09 pm Post subject: RE:How to input a command without pressing enter |
|
|
use getch
period |
|
|
|
|
 |
|
|