ti/getcsc.h
#include <ti/getcsc.h>
Naturally, TI’s operating system also has its own keyboard driver. This header is used to get the CSCs (current scan codes) from the keyboard driver.
You can easily use this header instead of the keypadc
library, and is particularly suited to non-game programs.
The OS’s interrupt handler handles the keyboard driver and caches a scancode when it detects a key press.
You can use this scancode directly without any translation of 2nd and alpha through the os_GetCSC
function.
API Documentation
TI’s keyboard interface defines.
- Authors
Matt “MateoConLechuga” Waltz
Jacob “jacobly” Young
Defines
-
os_KbdScanCode
uint8_t
: Cached GetCSC code.
-
sk_Down
-
sk_Left
-
sk_Right
-
sk_Up
-
sk_Enter
-
sk_2nd
-
sk_Clear
TI-84 Plus CE name.
-
sk_Alpha
-
sk_Add
-
sk_Sub
Subtract, not negate.
-
sk_Mul
-
sk_Div
-
sk_Graph
-
sk_Trace
-
sk_Zoom
-
sk_Window
TI-84 Plus CE name.
-
sk_Yequ
TI-84 Plus CE name.
-
sk_Mode
-
sk_Del
TI-84 Plus CE name.
-
sk_Store
-
sk_Ln
-
sk_Log
-
sk_Square
-
sk_Recip
TI-84 Plus CE [x^-1]; on the TI-83 Premium CE, this is [<>].
-
sk_Math
-
sk_0
-
sk_1
-
sk_4
-
sk_7
-
sk_2
-
sk_5
-
sk_8
-
sk_3
-
sk_6
-
sk_9
-
sk_Comma
-
sk_Sin
TI-84 Plus CE; on the TI-83 Premium CE, this is [TRIG]
-
sk_Apps
TI-84 Plus CE; on the TI-83 Premium CE, this is [MATRICE].
-
sk_GraphVar
X, T, theta, n.
-
sk_DecPnt
-
sk_LParen
-
sk_Cos
TI-84 Plus CE; on the TI-83 Premium CE, this is [RESOL].
-
sk_Prgm
-
sk_Stat
-
sk_Chs
Unary negation, not subtraction.
-
sk_RParen
-
sk_Tan
TI-84 Plus CE; on; the TI-83 Premium CE, this is the fraction template.
-
sk_Vars
-
sk_Power
[^]
-
sk_Fenetre
TI-83 Premium CE name.
-
sk_Fx
TI-83 Premium CE name.
-
sk_Suppr
TI-83 Premium CE name.
-
sk_TglExact
TI-83 Premium CE [<>]; it’s [x^-1] on the TI-84 Plus CE.
-
sk_Trig
TI-83 Premium CE; on the TI-84 Plus CE, this is [SIN].
-
sk_Matrice
TI-83 Premium CE; on the TI-84 Plus CE, this is [APPS].
-
sk_Resol
TI-83 Premium CE; on the TI-84 Plus CE, this is [COS].
-
sk_Frac
TI-83 Premium CE; on the TI-84 Plus CE, this is [TAN].
-
sk_Annul
TI-83 Premium CE name.
Functions
-
bool boot_CheckOnPressed(void)
Checks if the [on] key was pressed.
- Returns
True is returned if [on] key was pressed
-
uint8_t os_GetCSC(void)
Performs an OS call to get the keypad scan code.
This function does NOT block, use os_GetKey() if you need blocking.
This function does NOT account for 2nd/alpha modifiers. Use os_getKey() if you need to account for those
You can also use this function to get input from the user as a string like this:
Feel free to modify the string to suit your needs.const char *chars = "\0\0\0\0\0\0\0\0\0\0\"WRMH\0\0?[VQLG\0\0:ZUPKFC\0 YTOJEB\0\0XSNIDA\0\0\0\0\0\0\0\0"; uint8_t key, i = 0; char buffer[50]; while((key = os_GetCSC()) != sk_Enter) { if(chars[key]) { buffer[i++] = chars[key]; } }
- Returns
Keypad scan code or 0 if no key is pressed