Key definitions are stored in the _kbd_cmd[ ] array defined in vv_main.h.
To add more key definitions, do the following:
| 1 | Edit vvtermcap to add the new key definition commands. Mnemonics are provided for all function keys from F1 to F39. Use Sxxx as the mnemonic, where xxx is the mnemonic for the function key, to include Shift-function key combinations. Use Cxxx as the mnemonic, where xxx is the mnemonic for the function key, to include Ctrl-function key combinations. You can make up your own mnemonics for keycodes where Vermont Views has not provided a convention.
If desired, add an entry for the key label. The mnemonic for the key label field should follow the convention "L_xxx", where xxx is the mnemonic for the key definition. For Shift-function key combinations, the key label mnemonic is L_Sxxx. For Ctrl-function key combinations, the key label mnemonic is L_Cxxx. |
| 2 | In vv_main.h, edit the array key definition parse table _key_tbl[ ] by adding a KEYDEF structure for each key definition. In the structure, initialize the pointer to the mnemonic string to the string that you used in vvtermcap. Initialize the keycode to the keycode that you want to be generated by the keystroke sequence specified for the mnemonic.
Specify NULLP for the pointer to the string containing the key definition string, 0 for number of keystrokes that generates the keycode, and NULLP for the pointer to the key label string. These three structure members will be calculated and set by the Vermont Views initialization routine. |
| 3 | Edit the header file vv_key.h and create a #define for the key name that you will use in your code. |