[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[MiNT] Detecting whether a key is pressed



I have a particular requirement for GEM program, whereby it must be able
to determine whether a specified key is pressed at any time.

The AES only causes an event when a key is pressed, but not when it is
released, meaning that it is impossible to keep track of the state of a
given key.

I thought that I might be able to use MiNT's Psigintr function to cause my
program to be notified when data arrives from the keyboard. However I do
not believe this would work since although my program would be notified
that data had arrived from the keyboard, there would be no way to
determine what the data was.

An ideal answer would be some kind of system call or system variable which
reflects the current state of any key. However I do not believe there is
such a thing.

To clarify, I do not need to know when a key is pressed or released; only
whether it is currently pressed or released.

Does anyone have a suggestion as to how I could accomplish this, apart
from using a TSR program which monitors the status of the keys?

-- 
+-----------------------------------------------------------------------+
| Mario Becroft                * Tariland, New Zealand Atari User Group |
| mb@tos.pl.net                * Atari Hardware Developments            |
| http://www.ak.planet.gen.nz/~mario/ * Atari Serial Mouse Interface    |
+-----------------------------------------------------------------------+