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.

TI-83 Premium CE

Some keys on the TI-83 Premium CE are labeled differently, and some have completely different functions. For convenience, there are additional equates for the TI-83 Premium CE names. In the table below, the five keys with different functions are emphasized.

TI-84 Plus CE

Equate

TI-83 Premium CE

Equate

Y=

sk_Yequ

f(x)

sk_Fx

Window

sk_Window

Fenetre

sk_Fenetre

Del

sk_Del

Suppr

sk_Suppr

Apps

sk_Apps

Matrice

sk_Matrice

Clear

sk_Clear

Annul

sk_Annul

x^-1

sk_Recip

<>

sk_TglExact

Sin

sk_Sin

Trig

sk_Trig

Cos

sk_Cos

Resol

sk_Resol

Tan

sk_Tan

Fraction template

sk_Frac

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:

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];
    }
}
Feel free to modify the string to suit your needs.

Returns

Keypad scan code or 0 if no key is pressed