How Can i clean the bufer form the keyboard ?
I need to get only one key one i press on the keyboard .
for example: when i press 'W' and not releas the key I get
WWWWWWWWWWWWWWWW and I need ONLY one W ??????
Printable View
How Can i clean the bufer form the keyboard ?
I need to get only one key one i press on the keyboard .
for example: when i press 'W' and not releas the key I get
WWWWWWWWWWWWWWWW and I need ONLY one W ??????
do you mean in vb or....
if textbox , put it's max lengtht to 1
Are you using the GetAsyncKeyState api function to get the keyboard presses?
No I use GetKeyState in VB6.
bat i need to clean the bufer.
Store the state and xor it against the new state and you recieve the event.
Code:tempState=getasynckeystate(key)
if oldstate xor tempstate then event=cbool(tempstate)*2+1 else event=0
oldstate=tempstate
No !!!
The buffer still not clean ....
one access will clean it. Thats why you have to check the state all the time.