|
-
Nov 28th, 2000, 11:48 AM
#1
Thread Starter
New Member
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 ??????
-
Nov 28th, 2000, 11:53 AM
#2
Frenzied Member
do you mean in vb or....
if textbox , put it's max lengtht to 1
-
Nov 28th, 2000, 11:56 AM
#3
Fanatic Member
Are you using the GetAsyncKeyState api function to get the keyboard presses?
-
Nov 29th, 2000, 02:31 AM
#4
Thread Starter
New Member
No I use GetKeyState in VB6.
bat i need to clean the bufer.
-
Nov 29th, 2000, 03:22 AM
#5
transcendental analytic
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
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Nov 30th, 2000, 10:51 AM
#6
Thread Starter
New Member
No !!!
The buffer still not clean ....
-
Nov 30th, 2000, 08:20 PM
#7
transcendental analytic
one access will clean it. Thats why you have to check the state all the time.
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|