Caple C871i Instrukcja Użytkownika Strona 246

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 572
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 245
Apple II Computer Info
If you access the hardware directly, you will reduce the number of
situations in which your program will work properly. In particular,
it will NOT work properly in the background under GNO or another
multitasking system.
It also might not work reliably if something else has enabled the
Event Manager - keys might be swallowed behind your back as the Event
Manager's interrupt handler picks them up.
If you get keys using the Event Manager, then it will always work.
In shell programs, another option is to use the new calls provided by
ORCA/Shell 2.0.1 and later, and recent versions of GNO. The ORCA/Shell
implementation of the calls "KeyPress" and "ReadKey" will use the
Event Manager if it is active, or access the hardware directly.
The GNO implementation also copes with programs that have been
switched into the background, not providing them with any keypresses.
I wrote my own keyboard read routines that do the following:
1. Try the ORCA/Shell call.
2. If an error occured (older version of the shell, or no shell
present), and the Event Manager is active, then use it.
3. If all else fails, access the hardware directly.
This should work in any 16-bit environment (GNO, ORCA/Shell 2.0.1 or
later, older shell versions, a standalone application, CDA, etc.)
Note that if you do choose to access the hardware directly, make sure
you use $C025, $C000 and $C010 correctly. The proper sequence for
detecting a keypress and reading the modifiers is:
- Check for a keypress by looking at bit 7 of location $C000.
- If a key is available, read the modifiers from $C025, with the
associated key value from $C000.
- Reset the keyboard strobe by accessing $C010.
Note that if keyboard buffering is enabled, the modifiers will be
stable until the associated key is cleared. If keyboard buffering is
disabled, the modifiers can change on the fly (this is also the case
when buffering is enabled and no non-modifier has been pressed yet).
--
David Empson
Snail mail: P.O. Box 27-103, Wellington, New Zealand
###################################################### E N D O F F I L E
### keypresses
###################################################### E N D O F F I L E
Apple II Computer Technical Information : Apple II Family Hardware Info
ftp://ground.ecn.uiowa.edu/2/apple2/miscinfo/hardware : May 2001 : 246 of 572
Przeglądanie stron 245
1 2 ... 241 242 243 244 245 246 247 248 249 250 251 ... 571 572

Komentarze do niniejszej Instrukcji

Brak uwag