Link to home
Start Free TrialLog in
Avatar of zadijan
zadijan

asked on

Using INKEY$ in Visual Basic?

Is there any way to emulate INKEY$ in Visual Basic? I'm pretty sure there is some API in Windows that will let me. I can't use the form keypress events, because I'm emulating the DOS console as well (with the console API).
Avatar of fozylet
fozylet
Flag of India image

Public Declare Function GetAsyncKeyState Lib "user32" Alias "GetAsyncKeyState" (ByVal vKey As Long) As Integer

http://msdn.microsoft.com/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/KeyboardInput/KeyboardInputReference/KeyboardInputFunctions/GetAsyncKeyState.asp
Avatar of zadijan
zadijan

ASKER

Yes... but doesn't that only react to a specific key?
Avatar of zadijan

ASKER

Because what I'm looking for is a way to simulate a C-style getch() or getche().
ASKER CERTIFIED SOLUTION
Avatar of fozylet
fozylet
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zadijan

ASKER

Ah... thank you very much for your help.