cvs.gedasymbols.org/archives/browse.cgi   search  
Mail Archives: djgpp/1999/06/28/19:30:24

From: "Campbell, Rolf [SKY:1U32:EXCH]" <cp1v45 AT americasm01 DOT nt DOT com>
Newsgroups: comp.os.msdos.djgpp
Subject: Re: Key press in ASCII
Date: Mon, 28 Jun 1999 11:02:18 -0400
Organization: Nortel Networks
Lines: 24
Message-ID: <37778E7A.E4582ECC@americasm01.nt.com>
References: <7l5mhn$h9q$1 AT orudios DOT magnet DOT at>
NNTP-Posting-Host: bmerhc00.ca.nortel.com
Mime-Version: 1.0
X-Mailer: Mozilla 4.6 [en] (X11; I; HP-UX B.10.20 9000/712)
X-Accept-Language: en
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Mark Usher wrote:

> Is there a function available that will give me the ascii value of a key
> press back ? If not, is there an easy way to convert the key press returned
> from getkey() to it's ASCII value.
>
> Basically I am trying to add the key pressed to a string without having to
> press return.
> ie
>     key = getkey()
>     strcat(kbdbuffer, ASCII(key)

    What is "getkey()"?  If you use getch(), it returns the ascii value (as an
int).  If you need to add it to the end of a string:

char buff[2] = {0,0};
*buff = getch();
strcat(kbd, buff);

--
     -Rolf Campbell (39)3-6318



- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019