EV_getc Function (ROM Call 0xC8)

events.h

unsigned short EV_getc (unsigned short busy, EVENT *event);

Waits for the keypress, then fills an event structure with the keypress.

EV_getc is a function similar like ngetchx. It waits for a keypress, and returns the keycode of the keypress. But, in addition to ngetchx, it also fills the structure pointed to by event with appropriate CM_KEYPRESS event. Parameter busy may be ACTIVITY_IDLE, ACTIVITY_BUSY, ACTIVITY_PAUSED or ACTIVITY_NORMAL (these constants are defined in enum ST_ACTIVITIES). This parameter determines the indicator in the status line which will be displayed (see ST_busy for more info).

If there is no keypress and the cursor timer expires (cca 0.5 seconds), the message CM_BLINK is stored in the event structure instead, and the function returns zero (no keypresses). Also, this routine puts the calculator into low power mode until a character is available, and it will automatically power down the calculator if a key has not been pressed after a few minutes.


Uses: kbhit, ngetchx, ST_busy, CU_cursorState, idle, off, OSTimerExpired, OSTimerRestart, ROM Call 0x471
Used by: GT_KeyIn, ROM Call 0x3EA