why keybd_event or PostKeybdMessage are MUCH slower then using the SIP

T

tony

Hi,

i tried to send keystrokes from pictures control, and if i click -little-
fast, not all the keystrokes shows in the text box.

when i click on the virtual keyboard of the device(sip), it is MUCH faster.

im using win mobile 6, and samsung omnia device.

any idea how can create FAST keystrokes ?

btw, with the keybd_event i can't send characters that are not english cause
the parameter is byte.
but still, with the
PostKeybdMessage its slow.





sorry for the bad english.

any idea will help.
 
P

Paul G. Tobey [eMVP]

To what are you posting the keyboard data with those calls? I've never
noticed any problems with using them to send data at serial port speeds,
anyway, into the keyboard buffer. I've never seen it lose keystrokes no
matter what I'm doing. I'd suspect a bug in what your code actually does...

Paul T.
 
C

Chris Tacke, eMVP

is it the PostKeybdMessage that's slow, or the handling of the picturebox
click (plus probably repaint)? My bet is it's the latter. Have you done
any actual timed testing of the call to PostKeybdMessage?


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
T

tony

Thanks alot for your help.

I test it, and notice the problem is the picture box.
when i use the Button, the speed is ok, and if i tap 3 time, it write the
key 3 times and that's good.

The problem is, if use the Button im taking the focus..how others deal with
this ?
saving the last control focus in special param ?


Tnx.
 
P

Paul G. Tobey [eMVP]

How do we deal with *what*, exactly? You're using the MouseDown event of
the PictureBox? Or the MouseUp event? Or? Remember, we can't see your
code or read your mind. You have to tell us *everything* that we might
possibly need to understand what you are doing. Sending the code is often
better than asking a series of questions that might just result in asking
more questions of you, etc.

Paul T.
 
C

Chris Tacke, eMVP

Ok, so *what* exactly is slow. When you tap that picturebox more than one
thing happens. Is it the click? Is it a repaint? We have no idea what
you're doing so we can't even guess what might be taking a long time.


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Giving back to the embedded community
http://community.OpenNETCF.com
 
C

Chris Tacke, eMVP

Funny how this always seems to happen to me. I'm working on a project now
where I just ran into a near identical issue. It appears that the Click
handler is taking forever to run. I'd be interested to know why, but I
don't have time to investigate. If you look at MouseDown it's very fast
(that's what I'm using as a workaround). In fact you can trap a down and up
way faster than a click.

-Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top