Difference between revisions of "83Plus:BCALLs:4018"

From WikiTI
Jump to: navigation, search
(Diagonal arrow key presses!)
(Describe key repeat handling.)
 
(One intermediate revision by one other user not shown)
Line 8: Line 8:
  
 
=== Inputs ===
 
=== Inputs ===
* Set 0, (iy + 2Ch) to receive diagonal arrow key presses (but see comments)
+
* Set [[83Plus:Flags:2C|appWantDiagonalKeys, (iy + mouseFlag1)]] to receive diagonal arrow key presses (but see comments)
  
 
=== Outputs ===
 
=== Outputs ===
 
* A=([[83Plus:RAM:843F|kbdScanCode]])
 
* A=([[83Plus:RAM:843F|kbdScanCode]])
** down + left: 252
+
** May contain diagonal arrow key presses. Add these equates to your ti83plus.inc:
** down + right: 250
+
skDownLeft EQU 252
** up + left: 245
+
skDownRight EQU 250
** up + right: 243
+
skUpLeft EQU 245
 +
skUpRight EQU 243
 
* ([[83Plus:RAM:843F|kbdScanCode]])=0
 
* ([[83Plus:RAM:843F|kbdScanCode]])=0
 
* kbdSCR,(iy+kbdFlags) reset
 
* kbdSCR,(iy+kbdFlags) reset
 
  
 
=== Registers Destroyed ===
 
=== Registers Destroyed ===
Line 24: Line 24:
  
 
== Comments ==
 
== Comments ==
This routine expects that either interrupts are enabled or KbdScan was called manually.  Either of these routines will check the keyboard and load the appropriate scan code into the memory location kbdScanCode and set the flag kbdSCR,(iy+kbdFlags).
+
This routine expects that either interrupts are enabled or [[83Plus:BCALLS:4015|KbdScan]] was called manually.  Either of these routines will check the keyboard and load the appropriate scan code into the memory location kbdScanCode and set the flag kbdSCR,(iy+kbdFlags).
 +
 
 +
When polled by the OS interrupt with [[83Plus:BCALLs:4015|KbdScan]], only the arrow keys and DEL will repeat if held. All other keys will be returned only once until released and pressed again.
  
If you set 0, (iy + 2Ch) GetKey will return garbage values for diagonal arrow key presses. In particular, two of the combinations share the same value. So that flag obviously isn't meant for use with GetKey. You should not return to the OS with it set for that reason.
+
If you set appWantDiagonalKeys, (iy + mouseFlag1) GetKey will return garbage values for diagonal arrow key presses. In particular, two of the combinations share the same value. So that flag obviously isn't meant for use with GetKey. You should not return to the OS with it set for that reason.

Latest revision as of 18:35, 17 June 2020

Synopsis

Official Name: GetCSC

BCALL Address: 4018

This routine loads the most recent scan code into register A.

Inputs

Outputs

  • A=(kbdScanCode)
    • May contain diagonal arrow key presses. Add these equates to your ti83plus.inc:
skDownLeft		EQU	252
skDownRight		EQU	250
skUpLeft		EQU	245
skUpRight		EQU	243

Registers Destroyed

Comments

This routine expects that either interrupts are enabled or KbdScan was called manually. Either of these routines will check the keyboard and load the appropriate scan code into the memory location kbdScanCode and set the flag kbdSCR,(iy+kbdFlags).

When polled by the OS interrupt with KbdScan, only the arrow keys and DEL will repeat if held. All other keys will be returned only once until released and pressed again.

If you set appWantDiagonalKeys, (iy + mouseFlag1) GetKey will return garbage values for diagonal arrow key presses. In particular, two of the combinations share the same value. So that flag obviously isn't meant for use with GetKey. You should not return to the OS with it set for that reason.