|
-
Dec 17th, 2000, 03:08 PM
#1
Thread Starter
Hyperactive Member
I have a little problem using Winsock. I am using it to send a keystrokes - a single bytes representing ASCII codes. When you are typing (very) slowly, it works. But when you type more quickly, the I have troubles on client (maybe) side - the characters are higgledy-piggledy sorted, sometimes the whole groups of characters.
I tried to use something like this:
Code:
Sub Winsock1_DataArrival....
Winsock1.GetData d, vbArray+vbByte
Do While Recieving
Doevents
Loop
Recieving = True
...
Recieving = False
But this doesn't helped. How to get the right order, even they are quickly sent?
-
Dec 17th, 2000, 03:29 PM
#2
Fanatic Member
try this
comp 1
text1_keypress(keyascii as integer)
sock.senddata str(keyascii)
end sub
comp 2
sock_dataarrival
sock.getdata strIn
sendkeys strIn
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Dec 18th, 2000, 11:12 AM
#3
Thread Starter
Hyperactive Member
Yeh, I though about this, but I need to send a virtual keys too...
-
Dec 18th, 2000, 11:44 AM
#4
Fanatic Member
Why not make up your own protocol
$K=Press the space
etc
Kurt Simons
[I know I'm a hack but my clients don't!]
-
Dec 21st, 2000, 03:46 PM
#5
Thread Starter
Hyperactive Member
The protocol is good idea. It works well; but...
I tried to send the keys as strings - no change, the some letters are on ohter place than yhte should be.
-
Dec 21st, 2000, 04:23 PM
#6
Addicted Member
Hi,
Your caracters are sorted in the wrong order because of your DOEVENT... What I think is that the event is trigged a couple times and some of them are processed in the doevent inside the first event.
Try it without the doevent...
What is the scope of "D", global probably.
Also I can see you are using arrays of bytes...the best way to use getdata is with a string datatype.
The general idea is that the getdata only contains something like this :
winsock sub
dim sTemp as string
getdata sTemp
d = d & sTemp
end sub
AND you in a timer or something like this process the "d" variable
E-mail me if you want more info on this I think I got it pretty clear in my mind.
P.S. I've used Winsocks a lot and I'am convinced it should be spelled Winsuck as well as it's creator Microsucks :-)
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
|