Difference between revisions of "83Plus:Software:usb8x/Asm Interface/KBD/KBDGetMods"

From WikiTI
Jump to: navigation, search
 
(Oops, wrong routine first time around)
 
Line 1: Line 1:
 
== Synopsis ==
 
== Synopsis ==
'''Name:''' KBDCheckDirect
+
'''Name:''' KBDGetMods
  
 
'''Minimum usb8x version:''' 0.11
 
'''Minimum usb8x version:''' 0.11
  
Check for a key down in the keyboard matrix
+
Returns the current state of modifier and lock keys
  
 
=== Inputs ===
 
=== Inputs ===
* A: Raw key code to check
+
''None''
  
 
=== Outputs ===
 
=== Outputs ===
* Z: The key is currently being pressed
+
* A: Current modifier keys
 +
* B: Current lock keys
  
 
=== Destroys ===
 
=== Destroys ===
* AF, BC, HL
+
* BC, DE, HL
  
 
== Notes ==
 
== Notes ==
This routine checks whether a key is currently being pressed on the keyboard.  It will continue to return true as long as the key is held down.  This is equivilant to "direct input" on the built-in keypad.  The raw key equates used by this routine can be found in usb8x.inc.
+
The current modifier keys are returned from the last report received from the keyboard.  The lock keys are returned based on the internal state kept by the driver.  The lock key data is only valid if lock keys are being handled automatically by the driver (as indicated in flags passed to [[../KBDInit|KBDInit]]).
  
Most programs should instead use [[../KBDGetKey|KBDGetKey]], which provides higher level key press support.
+
Equate values for modifier keys and lock keys can be found in usb8x.inc.
 
+
== See Also ==
+
* [[../KBDGetKey|KBDGetKey]] - Get key presses
+

Latest revision as of 10:49, 27 August 2006

Synopsis

Name: KBDGetMods

Minimum usb8x version: 0.11

Returns the current state of modifier and lock keys

Inputs

None

Outputs

  • A: Current modifier keys
  • B: Current lock keys

Destroys

  • BC, DE, HL

Notes

The current modifier keys are returned from the last report received from the keyboard. The lock keys are returned based on the internal state kept by the driver. The lock key data is only valid if lock keys are being handled automatically by the driver (as indicated in flags passed to [[../KBDInit|KBDInit]]).

Equate values for modifier keys and lock keys can be found in usb8x.inc.