2019-11-19 18:52:21 +00:00
|
|
|
/**********************************************
|
|
|
|
* KEYDEFS - Test/Demo for keydefs.h02 module *
|
|
|
|
**********************************************/
|
|
|
|
|
|
|
|
//Specify System Header using -H option
|
|
|
|
#include <keydef.h02>
|
|
|
|
|
|
|
|
char key; //Key value
|
|
|
|
|
|
|
|
main:
|
|
|
|
putstr("PRESS KEYS TO SEE DEFINITIONS"); newlin();
|
|
|
|
while() {
|
|
|
|
key = getchr();
|
|
|
|
if (!key) continue;
|
|
|
|
select (key) {
|
2019-12-20 18:37:56 +00:00
|
|
|
case keys.bckspc: putstr("BACKSPACE");
|
|
|
|
case keys.break: putstr("BREAK");
|
|
|
|
case keys.clear: putstr("CLEAR");
|
|
|
|
case keys.copy: putstr("COPY");
|
|
|
|
case keys.delete: putstr("DELETE");
|
|
|
|
case keys.down: putstr("DOWN");
|
2020-10-14 03:22:44 +00:00
|
|
|
case keys.end: putstr("END");
|
2019-12-20 18:37:56 +00:00
|
|
|
case keys.escape: putstr("ESCAPE");
|
|
|
|
case keys.fn1: putstr("F1");
|
|
|
|
case keys.fn2: putstr("F2");
|
|
|
|
case keys.fn3: putstr("F3");
|
|
|
|
case keys.fn4: putstr("F4");
|
|
|
|
case keys.fn5: putstr("F5");
|
|
|
|
case keys.fn6: putstr("F6");
|
|
|
|
case keys.fn7: putstr("F7");
|
|
|
|
case keys.fn8: putstr("F8");
|
|
|
|
case keys.fn9: putstr("F9");
|
|
|
|
case keys.fn10: putstr("F10");
|
|
|
|
case keys.fn11: putstr("F11");
|
|
|
|
case keys.fn12: putstr("F12");
|
|
|
|
case keys.help: putstr("HELP");
|
|
|
|
case keys.home: putstr("HOME");
|
|
|
|
case keys.insert: putstr("INSERT");
|
|
|
|
case keys.left: putstr("LEFT");
|
|
|
|
case keys.lnfd: putstr("LINE FEED");
|
2020-10-14 03:22:44 +00:00
|
|
|
case keys.menu: putstr("MENU");
|
|
|
|
case keys.pagedn: putstr("PAGE DOWN");
|
|
|
|
case keys.pageup: putstr("PAGE UP");
|
2019-12-20 18:37:56 +00:00
|
|
|
case keys.return: putstr("RETURN");
|
2020-10-14 03:22:44 +00:00
|
|
|
case keys.right: putstr("RIGHT");
|
2019-12-20 18:37:56 +00:00
|
|
|
case keys.run: putstr("RUN");
|
|
|
|
case keys.rvsoff: putstr("RVS-OFF");
|
|
|
|
case keys.rvson: putstr("RVS-ON");
|
2020-10-14 03:22:44 +00:00
|
|
|
case keys.shfrtn: putstr("SHIFT-RETURN");
|
2019-12-20 18:37:56 +00:00
|
|
|
case keys.shfspc: putstr("SHIFT-SPACE");
|
|
|
|
case keys.shftab: putstr("SHIFT-TAB");
|
2020-10-14 03:22:44 +00:00
|
|
|
case keys.tab: putstr("TAB");
|
2019-12-20 18:37:56 +00:00
|
|
|
case keys.up: putstr("UP");
|
|
|
|
case ' ': putstr("SPACE");
|
2019-11-19 18:52:21 +00:00
|
|
|
default: if (key > ' ' and key <> #DELKEY) putchr(key);
|
|
|
|
}
|
|
|
|
putstr(" ["); prbyte(key); putstr("] ");
|
|
|
|
if (key == #ESCKEY) break;
|
|
|
|
}
|
|
|
|
goto exit;
|