home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <conio.h>
- #include "fastkey.h"
-
- /*──────────────────────────────────────────────────────────────────────────*/
- /* Purpose: To demonstrate the advantages of FASTKEY over the standard */
- /* method of checking the keyboard. */
- /*──────────────────────────────────────────────────────────────────────────*/
-
- void main() {
- int X=40, Y=20;
- char line[80];
-
- clrscr();
- printf("FastKey Demonstration - For Borland C++. Press Esc to exit.");
-
- InstallFastKey();
-
- while(!Pressed(FKEsc)) {
- gotoxy(X,Y); cputs("X");
- if (Pressed(FKLeft) && !Pressed(FKRight)) {
- gotoxy(X,Y); cputs(" ");
- if (X > 1) X--;
- };
- if (Pressed(FKRight) && !Pressed(FKLeft)) {
- gotoxy(X,Y); cputs(" ");
- if (X < 79) X++;
- };
- };
-
- UnInstallFastKey();
-
- clrscr();
- };