From: Keven Corazza on
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






From: " ctacke/>" on
You should probably be using PostKeybdMessage, not keybd_event


--
Chris Tacke
OpenNETCF Consulting
Managed Code in the Embedded World
www.opennetcf.com
--



"Keven Corazza" <KevenCorazza(a)discussions.microsoft.com> wrote in message
news:E2ECB4FF-885F-4CDB-A477-64DCA7FAE92E(a)microsoft.com...
> 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
>
>
>
>
>
>


From: Fabien on
Hi,

Check this, you have the virtual key codes :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/WinUI/WindowsUserInterface/UserInput/VirtualKeyCodes.asp

BR


Fabien Decret
Windows Embedded Consultant

ADENEO (ADESET)
http://www.adeneo.adetelgroup.com/




<ctacke/> a écrit :

> You should probably be using PostKeybdMessage, not keybd_event
>
>
> --
> Chris Tacke
> OpenNETCF Consulting
> Managed Code in the Embedded World
> www.opennetcf.com
> --
>
>
>
> "Keven Corazza" <KevenCorazza(a)discussions.microsoft.com> wrote in message
> news:E2ECB4FF-885F-4CDB-A477-64DCA7FAE92E(a)microsoft.com...
> > 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
> >
> >
> >
> >
> >
> >

From: "Paul G. Tobey [eMVP]" p space tobey no spam AT no instrument no spam DOT on
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.

"Keven Corazza" <KevenCorazza(a)discussions.microsoft.com> wrote in message
news:E2ECB4FF-885F-4CDB-A477-64DCA7FAE92E(a)microsoft.com...
> 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
>
>
>
>
>
>