🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15412

Re: Keybd_event with an Ansi Code

#15412
From: Remy Lebeau (TeamB)
Date: Sat, 05 Jul 2003 00:30
30 lines
1893 bytes
"Josh Kirkpatrick" <jkirkpat@softhome.net> wrote in message
news:3f02546f$1@newsgroups.borland.com...

> I have a string ("VK_A") and I would like to use
> keybd_event with this character.  How to I convert
> the string to a BYTE, so it can be passed as bVk?

Do you mean that you are accepting such a string as input from the user or a
file or such, and need to translate it?  If so, then you have to write your
own parsing algorithm for that, or else use a lookup table instead.

Or do you just want to call keybd_event() passing it VK_A directly?  If so,
then just do so:

    keybd_event(VK_A, ...);

Either way, actually there is no actual VK_A define that is declared,
despite what the API documentation suggests.  You need to use an actual 'A'
character instead, or make your own define manually:

    keybd_event('A', ...);

Or

    #define VK_A        'A'
    keybd_event(VK_A, ...);


Gambit
Technical Details
Message-ID: <3f061b2a@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <3f02546f$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,285c18b4f22a6705
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-07-04 17:39:41 PST
From: "Remy Lebeau \(TeamB\)" <gambit47@yahoo.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f02546f$1@newsgroups.borland.com>
Subject: Re: Keybd_event with an Ansi Code
Date: Fri, 4 Jul 2003 17:30:57 -0700
Lines: 32
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 207.175.226.26
Message-ID: <3f061b2a@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1057364778 207.175.226.26 (4 Jul 2003 17:26:18 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-04!sn-xit-01!sn-xit-09!supernews.com!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail