What about a better keyboardinkey()?

Advanced game related topics
Poshu
Enthusiast
Enthusiast
Posts: 459
Joined: Tue Jan 25, 2005 7:01 pm
Location: Canada

What about a better keyboardinkey()?

Post by Poshu »

Hello ^^
I need a way to let user write in an openscreen(), that's why I tried keyboardinkey().
But I don't like the way it works (the chr appears after you release the key) that's why I am looking for a better function.
Does someone can help me for this?
dracflamloc
Addict
Addict
Posts: 1648
Joined: Mon Sep 20, 2004 3:52 pm
Contact:

Post by dracflamloc »

Yea it's pretty shoddy and has many bugs which I've reported before...
User avatar
oakvalley
User
User
Posts: 77
Joined: Sun Aug 08, 2004 6:34 pm
Location: Norway
Contact:

Post by oakvalley »

I use GetAsyncKeyState_() all the time. It's API stuff, and Windows take
care of the inputs. In a loop it will detect when you a press a key DOWN,
and not when you release it..

Quick code like:

Repeat
If GetAsyncKeyState_($53) & $1
; You pressed S key
End
EndIf
Delay(1)
ForEver

Use these HEX values from this MSDN table:

http://msdn.microsoft.com/library/defau ... yCodes.asp
Regards Stone Oakvalley
Currently @ PB 5.70
Post Reply