[comp.sys.amiga] Straightforward examples sought

john13@garfield.UUCP (John Russell) (12/23/87)

I'm looking for illustrative examples in source code on a couple of topics.

First is list creation/handling using the Exec functions. Is it just me or are
these terribly documented? The reference I use (Amiga Programmer's Handbook)
doesn't mention the NewList() function and neither it nor the RKM is very
helpful about what has to be initialized manually and what the system will
do for you. 

Also handling of Intuition RAWKEY messages. I wrote a stub which will take
the IntuiMessage->Code and handle meta-key actions, all the printable
characters, and call functions when special keys (eg the arrows or function
keys) are pressed. However I wouldn't like to be accused of ignoring the
keymaps, so can these RAWKEY messages be parsed properly without having to
mess around with the console device (which RawKeyConvert() wants to see,
apparently)? I want to avoid the console handler entirely if possible and work
just with Intuition.

John
-- 
"...and intuition, in a case such as this, is of crucial importance."
			-- William Gibson, _Count_Zero_

bryce@hoser.berkeley.edu (Bryce Nesbitt) (12/25/87)

In article <4312@garfield.UUCP> john13@garfield.UUCP (John Russell) writes:
>I'm looking for illustrative examples in source code on a couple of topics.
>
>...so can these RAWKEY messages be parsed properly without having to
>mess around with the console device (which RawKeyConvert() wants to see,
>apparently)?

NO!

If you want the special keys (cursor, HELP, etc.) you MUST get RAWKEY
messages and process them with DeadKeyConvert().

If you don't care about the special keys, change "RAWKEY" in your program
to "VANILLAKEY".


I posted a complete ready-to-fly example to comp.sources.amiga.  It was
about a week or two that it showed up.  Find it, use it.


>I want to avoid the console handler entirely if possible and work
>just with Intuition.

You won't need to use the console handler, just get the address of it.
Very straightforward.
See the source code for full details.

|\ /|  . Ack! (NAK, SOH, EOT)
{o O} . bryce@hoser.berkeley.EDU -or- ucbvax!hoser!bryce (or try "cogsci")
 (")
  U	"Your theory is crazy... but not crazy enought to be true." -Niels Bohr

ewhac@well.UUCP (Leo 'Bols Ewhac' Schwab) (12/25/87)

In article <4312@garfield.UUCP> john13@garfield.UUCP (John Russell) writes:
>I'm looking for illustrative examples in source code on a couple of topics.
>
>First is list creation/handling using the Exec functions. Is it just me or are
>these terribly documented? The reference I use (Amiga Programmer's Handbook)
>doesn't mention the NewList() function and neither it nor the RKM is very
>helpful about what has to be initialized manually and what the system will
>do for you. 
>
	NewList() is (I'm 99.44% sure) provided in the Exec support library,
which gets linked to your program.  It works like this:
--------
foo ()
{
	struct List	list;

	NewList (&list);
}
--------
	Ta da!

_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_
Leo L. Schwab -- The Guy in The Cape	ihnp4!ptsfa -\
 \_ -_		Recumbent Bikes:	      dual ---> !{well,unicom}!ewhac
O----^o	      The Only Way To Fly.	      hplabs / (pronounced "AE-wack")
"Work FOR?  I don't work FOR anybody!  I'm just having fun."  -- The Doctor