From: | Rod Schnell |
Date: | 09 Dec 99 at 03:49:13 |
Subject: | Re: Reading keypresses |
From: Rod Schnell <rodsch@telusplanet.net>
Hello Donald
On 08-Dec-99, Donald W Millican wrote:
>
> I get the key code from the Code field of the Intuimessage I am sent by
> Intuition and parse it as follows:
>
> switch(code)
> {
> case `1`:
> // Deal with a 1 being entered
> break;
> etc.
>
> I thought I could read Space as:
> case ` `:
> printf("Space entered");
> and Return / Enter as:
> case `\n`:
> printf("Return / Enter entered");
>
> I have tried these ideas but the messages are never displayed no matter
> which way I go about displaying them.
>
> Any ideas?
>
Are you reading IDCMP_VANILLAKEY? If I recall correctly, non printable keys
such as return won't show up with IDCMP_VANILLAKEY, use IDCMP_RAWKEY instead.
I may be wrong about this though.
Your space case should work regardless. Try using printf("Space entered\n");,
'\n' ensures it will print immediately without needing to flush output.
Regards Rod