;;; ;;; This is a sample EDWIN.INI file to demonstrate how to customize EDWIN for ;;; both keyboard input and display output. When placed in the same directory ;;; as PC Scheme, it will be loaded automatically the first time EDWIN is ;;; entered ;;; ;;; ;;; The following code is an example of customizing the color of Edwin's ;;; three windows; the editing buffer, the mode line, and the echo area. ;;; In the example, the text attribute of each window is set to a color ;;; that is different from the other windows. I'm not suggesting that you ;;; will like the colors, just that they are different. ;;; ;;; In order to write a general example (that will work for either TI or ;;; IBM machines), the PC Scheme variable PCS-MACHINE-TYPE is examined and ;;; the colors set according to the type of machine. TI is type 1 and the ;;; character-enable bit must be set by adding 8 to the color. Feel free to ;;; experiment with the code to determine a configuration that you are ;;; comfortable with ;;; ;;; ;;;(let ((type (if (eq? 1 pcs-machine-type) 8 0))) ;;; (window-set-attribute! buffer-screen 'text-attributes (+ type 7)) ;;; (window-set-attribute! modeline-screen 'text-attributes (+ type 6)) ;;; (window-set-attribute! typein-screen 'text-attributes (+ type 3))) ;;; ;;; The following code is used to customize your keyboard for use with EDWIN. ;;; It allows you to define new key sequences in terms of existing EDWIN key ;;; sequences. REMAP-EDWIN-KEY is a macro which takes two arguments, the new ;;; key sequence you wish to define, and the existing EDWIN key sequence. The ;;; arguments may be either a character or a list of characters representing ;;; the key codes for your particular machine. The key codes for your machine ;;; can be found in the technical reference manual for your machine, or by ;;; executing the function GET-KEYCODE. GET-KEYCODE allows you to enter any ;;; single key sequence, and returns the corresponding code to use with ;;; REMAP-EDWIN-KEY. ;;; ;;; Remember that EDWIN commands (represented by certain key sequences) are of ;;; 5 basic types; simple, control, meta, meta-control, and control-x. SIMPLE ;;; commands are single character commands (normally just insert into the ;;; buffer), CONTROL commands are entered by typing the ctrl key while pressing ;;; another character, META commands are entered by pressing either the escape ;;; or ctrl-z keys and then typing another character, META-CONTROL commands are ;;; entered by typing the meta prefix and then a ctrl key sequence, and ;;; CONTROL-X commands are entered by typing ctrl-x followed by another key ;;; sequence. ;;; ;;; The key codes for CTRL key sequences varies depending on the control key ;;; sequence entered. Some codes returned from the keyboard are extended key ;;; codes, or an extended code of 0 followed by the key code. For example, the ;;; key code returned from pressing CTRL-@ is a two key code of the extended ;;; key code (0) followed by the integer 3; this is represented in the following ;;; code as the list (extended-char (integer->char 3)). Use GET-KEYCODE to ;;; obtain the key codes necessary to remap keys via EDWIN-REMAP-KEY. (define meta-char (integer->char 27)) ; Key code for Edwin META key (define ctrl-x (integer->char 24)) ; Key code for Edwin CTRL-X (define extended-char (integer->char 0)) ; Denotes an extended key code ; ; This is a helper function which returns the key codes for any single ; key sequence. It is useful in determining the key codes returned from ; your particular machine and can be used to determine the arguments for ; REMAP-EDWIN-KEY ; (define (get-keycode) (let ((code (read-char))) (if (char=? code (integer->char 0)) `(list extended-char (integer->char ,(char->integer (read-char)))) `(integer->char ,(char->integer code))))) ; ; Redefine keys. The following will work for either TI or IBM machines. ; (remap-edwin-key (list extended-char (integer->char 59)) ;New Key = F1 (integer->char 22)) ;Old Key = CNTRL-V (Scroll Up) (remap-edwin-key (list extended-char (integer->char 60)) ;New Key = F2 (list meta-char #\V)) ;Old key = Meta-V (Scroll Down) (remap-edwin-key (list extended-char (integer->char 61)) ;New Key = F3 (list extended-char (integer->char 3))) ;Old Key = CNTRL-@ (Set Mark) (remap-edwin-key (list extended-char (integer->char 62)) ;New Key = F4 (list (integer->char 24) ;Old key = CNTRL-X CNTRL-X (integer->char 24))) ; (Xchg mark and point) (remap-edwin-key (list extended-char (integer->char 63)) ;New key = F5 (integer->char 23)) ;Old Key = CNTRL-W (Kill Region) (remap-edwin-key (list extended-char (integer->char 64)) ;New key = F6 (integer->char 25)) ;Old key = CNTRL-Y (Unkill) (remap-edwin-key (list extended-char (integer->char 67)) ;New key = F9 (list meta-char (integer->char 60))) ;Old key = META < (Go buffer top) (remap-edwin-key (list extended-char (integer->char 68)) ;New key = F10 (list meta-char (integer->char 62))) ;Old key = META > (buffer bottom) (remap-edwin-key (list extended-char (integer->char 83)) ;New Key = DEL (integer->char 04)) ;Old Key = CNTRL-D (remap-edwin-key (list extended-char (integer->char 115)) ;New key = CNTRL <- (list meta-char (integer->char 02))) ;Old key = META-CNTRL-B ;Move forward over s-exp (remap-edwin-key (list extended-char (integer->char 116)) ;New Key = CNTRL -> (list meta-char (integer->char 06))) ;Old key = META-CNTRL-F ;Move backward over s-exp