#### Archived

This topic is now archived and is closed to further replies.

# using keybd_event() correctly

## Recommended Posts

When I use keybd_event() like this:
string str = "CaSeSeNsItIvE @£$" for (int i=0; i); keybd_event(c,0,0,0); keybd_event(c,0,KeyUp,0); } where KeyUp is defined as the WM_KEYUP, the output is all lowercase, even the @£$ come out as ''3 and 4 (the numbers under them, on my keyboard anyway) How do I use keybd_event() so whatever I send the output is the same?

##### Share on other sites
(I''m not positive, but if I had to guess...)

When You press a key on the keyboard, say ''a'', it just sends ''a'' to the computer. Now if you''re holding down shift at the same time (i.e. trying to type ''A'') then the computer get''s ''a'' and ''shift'' and has to interpret that into ''A''. So maybe the int representations of ''a'' and ''A'' are interpreted just as ''a'' when it''s a keyboard event.

The deal with the @\$ and 34 stuff is probably something along the same lines.

##### Share on other sites
its ok, iv done it now

[edited by - Malpass on May 2, 2003 6:18:59 PM]

• ### Forum Statistics

• Total Topics
628368
• Total Posts
2982293

• 10
• 9
• 13
• 24
• 11