The text of a manual · part 9 of 19
PDT 3200 Run-Time Library Reference Manual: Chapter 2 Function Reference, pages 69 to 78
Pages 69 to 78 of 168, from PDT 3200 Run-Time Library Reference Manual
The original document is the PDF (949 KB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Symbol PDT-3200
Page 69
Chapter 2: Function Reference extflags = BIOS_GetKeyExtFlags(); if ((flags != oldflags) || (extflags != oldextflags)) { oldflags = flags; oldextflags = extflags; stateChanges++; BIOS_SetCurXY(0,0); printf ("Flags:\n"); if (flags&P_KBDSHIFT_CTRL) printf ("CTRL "); else printf (" "); if (flags&P_KBDSHIFT_ALT) printf ("ALT "); else printf (" "); if (flags&P_KBDSHIFT_INS) printf ("INS "); else printf (" "); if (flags&P_KBDSHIFT_CAPS) printf ("CAP "); else printf (" "); printf ("\n"); printf ("Ext Flags:\n"); if (extflags&P_KBDSHIFT_CTRL) printf ("CTRL "); else printf (" "); if (extflags&P_KBDSHIFT_ALT) printf ("ALT "); else printf (" "); if (extflags&P_KBDSHIFT_INS) printf ("INS "); else printf (" "); if (extflags&P_KBDSHIFT_CAPS) printf ("CAP "); else printf (" "); printf ("\n"); printf ("DOWN:\n"); if (extflags&P_KBDSHIFT_CTRL_DOWN) printf ("CTRL "); else printf (" "); if (extflags&P_KBDSHIFT_ALT_DOWN) printf ("ALT "); else printf (" "); if (extflags&P_KBDSHIFT_CAPS_DOWN) printf ("CAPS "); else printf (" "); printf ("\n"); } } return; }
2-41
Page 70
PDT 3200 Run-Time Library Reference Manual
BIOS_GetKeyInputState p_bios.h Syntax UINT BIOS_GetKeyInputState(void);
Description Checks the keyboard buffer to see if a keystroke is waiting to be read. Any keystroke waiting is read and returned. The keystroke is not removed from the keyboard buffer.
Parameters None.
Returns Bit ßags deÞned by the following constants. These ßags may be combined in any logical combination. P_KBDSTATE_ALPHA_DOWN P_KBDSTATE_CAPS_DOWN P_KBDSTATE_ALT_DOWN P_KBDSTATE_CTRL_DOWN P_KBDSTATE_FUNC2_DOWN P_KBDSTATE_FUNC1_DOWN P_KBDSTATE_INTL P_KBDSTATE_PRGM P_KBDSTATE_ALPHA P_KBDSTATE_CAPS P_KBDSTATE_ALT P_KBDSTATE_CTRL P_KBDSTATE_FUNC2 P_KBDSTATE_FUNC1
2-42
ALPHA key is pressed. CAPS LOCK key is pressed. ALT key is pressed. CTRL key is pressed. FN 2 key is pressed. FN 1 key is pressed. Unit is in international-character entry mode. Unit is in programming mode. Unit is in alpha mode. CAPS LOCK is active. ALT is active. CTRL is active. FN 2 is active. FN 1 is active.
Page 71
Chapter 2: Function Reference
Sample #include <stdio.h> #include "p_bios.h" void UnitKeyStatusFlags(void) { int stateChanges = 0; UINT flags, oldflags = 0; BIOS_ClearScreen(P_ATT_NORM); // Display status of special keys through 50 state changes while (stateChanges < 50) { flags = BIOS_GetKeyInputState(); if (flags != oldflags) { oldflags = flags; stateChanges++; BIOS_SetCurXY(0,0); if (flags&P_KBDSTATE_CTRL) printf ("CTRL "); else printf (" "); if (flags&P_KBDSTATE_ALT) printf ("ALT "); else printf (" "); if (flags&P_KBDSTATE_FUNC1) printf ("FN1 "); else printf (" "); if (flags&P_KBDSTATE_FUNC2) printf ("FN2 "); else printf (" "); printf ("\n"); if (flags&P_KBDSTATE_CAPS) printf ("CAP "); else printf (" "); if (flags&P_KBDSTATE_ALPHA) printf ("ALP "); else printf (" "); if (flags&P_KBDSTATE_PRGM) printf ("PGM "); else printf (" "); if (flags&P_KBDSTATE_INTL) printf ("INTL"); else printf (" "); printf ("\n"); printf ("DOWN:\n"); if (flags&P_KBDSTATE_CTRL_DOWN) printf ("CTRL "); else printf (" "); if (flags&P_KBDSTATE_ALT_DOWN) printf ("ALT "); else printf (" "); if (flags&P_KBDSTATE_FUNC1_DOWN) printf ("FN1 "); else printf (" "); if (flags&P_KBDSTATE_FUNC2_DOWN) printf ("FN2 "); else printf (" "); printf ("\n"); if (flags&P_KBDSTATE_CAPS_DOWN) printf ("CAP "); else printf (" ");
2-43
Page 72
PDT 3200 Run-Time Library Reference Manual if (flags&P_KBDSTATE_ALPHA_DOWN) printf ("ALP "); else printf (" "); printf ("\n"); } } // Clear all states BIOS_SetKeyInputState (0); return; }
2-44
Page 73
Chapter 2: Function Reference
BIOS_GetKeyStatus p_bios.h Syntax int BIOS_GetKeyStatus(UCHAR *ScanCode, UCHAR *Ch);
Description Checks the keyboard buffer to see if a keystroke is waiting to be read. Any keystroke waiting is read and returned. The keystroke is not removed from the keyboard buffer.
Parameters None.
Returns ScanCode Char FALSE TRUE
Scan code of the key pressed. ASCII value of key pressed. Keystroke is not waiting. Keystroke is waiting.
Sample See BIOS_APMGetStatus.
2-45
Page 74
PDT 3200 Run-Time Library Reference Manual
BIOS_GetSpeakerAlternate p_bios.h Syntax UCHAR BIOS_GetSpeakerAlternate(void);
Description Returns the alternate speaker tone setting.
Parameters None.
Returns 0–7
Sample See BIOS_GetKbdCtrl().
2-46
Index into alternate speaker tone table. The table designates speciÞc frequencies. 0 is the lowest frequency; 7 is the highest.
Page 75
Chapter 2: Function Reference
BIOS_GetSpeakerVolume p_bios.h Syntax UCHAR BIOS_GetSpeakerVolume(void);
Description Returns the speaker volume setting.
Parameters None.
Returns P_SNDVOL_OFF 1–7
Speaker is turned off. Volume settings with 1 being the softest and 7 being the loudest.
Sample See BIOS_GetKbdCtrl().
2-47
Page 76
PDT 3200 Run-Time Library Reference Manual
BIOS_GetTickCount p_bios.h Syntax ULONG BIOS_GetTickCount(UINT *PastMidnight);
Description Returns the number of clock ticks since midnight. If midnight has been passed since last read, the PastMidnight ßag is set.
Parameters None.
Returns PastMidnight Clock Ticks
Sample None.
2-48
Flag indicating that midnight was passed since last read. Clock ticks since midnight (0Ð1,573,040).
Page 77
Chapter 2: Function Reference
BIOS_GetTime p_bios.h Syntax void BIOS_GetTime(UINT *Hours, UINT *Minutes, UINT *Seconds, UINT *DST);
Description Returns the system time.
Parameters None.
Returns Hours Minutes Seconds DST
Hours (0Ð23). Minutes (0Ð59). Seconds (0Ð59). Daylight savings time ßag. FALSE (0) if not daylight savings time; TRUE (1) if it is daylight savings time.
Sample See BIOS_GetDate().
2-49
Page 78
PDT 3200 Run-Time Library Reference Manual
BIOS_GetVideoColumns p_bios.h Syntax UINT BIOS_GetVideoColumns(void);
Description Returns the number of character columns available for the current video mode.
Parameters None.
Returns Columns
Sample See BIOS_ClearScreen().
2-50
Number of columns available. This is typically 40 or 80.