Use of keybd_event for some characters

G

Guest

Hi,

I'm using keybd_event to simulate the keyboard. I'm not able to simulate
some characters like , ? _ =

I've tried in many way but I'm not able to find the combination to get this
result.

Looking to windows virtual keyboard I've tried this lines of code:

keybd_event(0x10, 0, 0, true); // shift down
keybd_event((byte)Keys.Divide, 0, 0, true); // divide down
keybd_event((byte)Keys.Divide, 0, 2, true); // divide up
keybd_event(0x10, 0, 2, true); // shift up

This because the ? character appears, over the button /, when you press
Shift button.

I did the same job, with success, for the characters over the number (D0,
D1, ...). The example below generate the character ) that is exactly the
character over 0.

keybd_event(0x10, 0, 0, true); // shift down
keybd_event((byte)Keys.D0, 0, 0, true); // 0 down
keybd_event((byte)Keys.D0, 0, 2, true); // 0 up
keybd_event(0x10, 0, 2, true); // shift up

What can I do to simulate the character ? and the others ?

Thank you in advance for your help.

Keven Corazza
 
P

Paul G. Tobey [eMVP]

Printable characters should be posted using PostKeybdEvent(). Unprintable
characters should use keybd_event(). That's the logic I used in my
'wedging' applications.

Paul T.
 

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