[comp.sys.amiga.programmer] keyboard input

hinds@cs.swarthmore.edu (Alexander Hinds) (05/03/91)

	I'm writing a program (game) in which I need to get keyboard
input in the fastest way possible, ie. not through intuition.  (i'm
doing this now, and getting alot of overhead.)  I was thinking of
using the keyboard.device, but that would interfere with the input.device.
So, does anybody have any ideas they could float my way?  Thanks.

Alexander Hinds

jdickson@jato.jpl.nasa.gov (Jeff Dickson) (05/03/91)

In article <4HG28HR@cs.swarthmore.edu> hinds@cs.swarthmore.edu (Alexander Hinds) writes:
>
>	I'm writing a program (game) in which I need to get keyboard
>input in the fastest way possible, ie. not through intuition.  (i'm
>doing this now, and getting alot of overhead.)  I was thinking of
>using the keyboard.device, but that would interfere with the input.device.
>So, does anybody have any ideas they could float my way?  Thanks.
>
>Alexander Hinds

	Why not instead insert your own custom handler into the input.device
event chain ahead of intuition (pri < 50). A handler can decide if the event
is to be propagated or not. When your window was the active one, you would
prevent intuition from seeing keyboard.device events, because you would be
handling them directly (by virtue you're ahead of intuition). 

	-jeff

farrier@Apple.COM (Cary Farrier) (05/03/91)

In article <4HG28HR@cs.swarthmore.edu> hinds@cs.swarthmore.edu (Alexander Hinds) writes:
> [...wants input in a fast way...]

You could create your own input handler and place it in the input
stream ahead of intuition.  There is an example of this called
'input.dev' by Rob Peck on Fish #5 and is discussed in the Input
Device chapter of the Rom Kernal Manual: Libraries and Devices.

>Alexander Hinds

-- Cary

peter@cbmvax.commodore.com (Peter Cherna) (05/03/91)

In article <1991May2.213909.13075@jato.jpl.nasa.gov> jdickson@jato.Jpl.Nasa.Gov (Jeff Dickson) writes:
>	Why not instead insert your own custom handler into the input.device
>event chain ahead of intuition (pri < 50).

To be ahead of Intuition, your handler has to have a priority > 50.

>	-jeff

     Peter
--
Peter Cherna, Operating Systems Development Group, Commodore-Amiga, Inc.
{uunet|rutgers}!cbmvax!peter    peter@cbmvax.commodore.com
My opinions do not necessarily represent the opinions of my employer.
"If all you have is a hammer, everything looks like a nail."