;; Key codes returned for most Alt keys and Control-keypad keys
;; These were determined from an IBM XT and are useful for defining
;; keys.

;; example:  define Alt-1 to goto top of buffer (bob):
;;
;;     setkey ("bob",  "^@x");
;;
;; For other keys, use this function to find out what they represent:
;;
define ibmpc_showkey()
{
   variable c, ch, key = Null_String;
   variable timeout = 50;  % 5 seconds
   
   flush ("Press key:");
   
   while (input_pending(timeout))
     {
	timeout = 0;
	c = getkey();
	if (c == 0) ch = "^@"; else ch = char (c);
	key = strcat(key, ch);
     }
   message (key);
}


% Alt-1	^@x
% Alt-2	^@y 
% Alt-3	^@z
% Alt-4	^@{
% Alt-5	^@|
% Alt-6	^@}
% Alt-7	^@~
% Alt-8	^@
% Alt-A	^@^^
% Alt-B	^@0
% Alt-C	^@.
% Alt-D	^@ SPACE
% Alt-E	^@^R
% Alt-F	^@!
% Alt-G	^@\"
% Alt-H	^@#
% Alt-I	^@^W
% Alt-J	^@$
% Alt-K	^@%
% Alt-L	^@&
% Alt-M	^@2
% Alt-N	^@1
% Alt-O	^@^X
% Alt-P	^@^Y
% Alt-Q	^@^P
% Alt-R	^@^S
% Alt-S	^@^_ 
% Alt-T	^@^T
% Alt-U	^@^V
% Alt-V	^@/
% Alt-W	^@^Q
% Alt-X	^@-
% Alt-Y	^@^U
% Alt-Z	^@,
% 
% Ctrl-End  ^@u
% Ctrl-PgDn ^@v
% Ctrl-PgUp ^@\d132             % the \d means following digits are decimal
% ctrl-left ^@s
% Ctrl-right ^@t
% Ctrl-Home ^@w
% 
% 
% F1: ^@;    Alt-F1: ^@h    Shift-F1: ^@T    Ctrl-F1: ^@^
% F2: ^@<    Alt-F2: ^@i    Shift-F2: ^@U    Ctrl-F2: ^@_
% F3: ^@=    Alt-F3: ^@j    Shift-F3: ^@V    Ctrl-F3: ^@`
% F4: ^@>    Alt-F4: ^@k    Shift-F4: ^@W    Ctrl-F4: ^@a
% F5: ^@?    Alt-F5: ^@l    Shift-F5: ^@X    Ctrl-F5: ^@b
% F6: ^@@    Alt-F6: ^@m    Shift-F6: ^@Y    Ctrl-F6: ^@c
% F7: ^@A    Alt-F7: ^@n    Shift-F7: ^@A    Ctrl-F7: ^@A
% F8: ^@B    Alt-F8: ^@o    Shift-F8: ^@[    Ctrl-F8: ^@B
% F9: XF10: ^@D   Alt-F10: ^@q   Shift-F10: ^@]   Ctrl-F10:  ^@g
