home *** CD-ROM | disk | FTP | other *** search
- \ FUNKEY.SEQ Function key functions by Tom Zimmer
-
- ?dark
- .comment:
- This file allows assigning functions to the keys F1 through F10.
-
- The following sequence will assign the F9 and F10 keys to perform
- the Forth functions B (Back screen), and N (Next screen):
-
- 9 FN! B <enter>
- 10 FN! N <enter>
-
- After the above commands have been entered, you may press F9 when you
- want to display the previous screen in the current file, and F10 to
- display the next screen in the current file.
-
- The word .FN will display a list of the current function key
- assignments.
-
- The words FUNON and FUNOFF will enable and disable the function keys
- temporarily when their operation is not desired.
-
- comment;
-
- comment:
-
- !!!!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
-
- Function keys WILL interfere with the editor, or any program that
- uses function keys for other things. BE SURE to do a FUNOFF before
- starting the editor.
-
- comment;
-
-
- create f#funcs ' noop dup , dup , dup , dup , dup ,
- dup , dup , dup , dup , ,
-
- variable funflg funflg off
-
- : funon funflg on ;
- : funoff funflg off ;
-
- : funkey ( --- c1 )
- funflg @
- if begin defers key dup 187 dup 9 + between
- if 187 - 2* f#funcs + perform
- 0
- else true
- then
- until
- else defers key
- then ;
-
- ' funkey is key
-
- : fn! ( n1 | name --- )
- 1 max 10 min 1- 2* f#funcs + ' swap ! ;
-
- : .fn ( --- )
- cr ." Function key assignments, Functions are "
- funflg @ if ." ENABLED" else ." DISABLED" then
- f#funcs 10 0
- do dup cr i 1+
- 0 <# #s ascii F hold #> 8 over - spaces type ." = "
- i 2* + @ >name .id
- loop drop ;
-
- 9 fn! B \ define Function keys F9 and F10 to be B and N.
- 10 fn! N
- funon \ Enable function keys
-