• Advertisement

Archived

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

using keybd_event() correctly

This topic is 5408 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
(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 this post


Link to post
Share on other sites
its ok, iv done it now

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

Share this post


Link to post
Share on other sites

  • Advertisement