Keyboard Customization and Keyboard Macros
Contents of Article
Since most interaction with an editor is through the keyboard, the ability to customize it greatly affects your productivity. The Key Mapping features in SPFLite reflect the importance of this.
The Keyboard tab of the Options dialog provides basic on/off options to control scrolling using the arrow keys, whether the editor defaults to Insert Mode, and how Insert Mode Reset is handled. See Options - Keyboard for details.
All other keyboard customization is performed in the Keymap dialog. This dialog is reached by entering the KEYMAP primary command.
You can also use the KEY or KEYS aliases to bring up the same Keymap dialog, similar to ISPF.
From this dialog you can:
- Customize the activity that each key or key combination performs
- Assign primary commands, line commands or keyboard primitive functions to be performed by each key
- Provide optional labels to key mappings, so these can be displayed as Key Help information on the screen
- Create keyboard macros to perform a series of keyboard activities, and assign that sequence to any key or key combination
- Define the actions to be performed when the mouse buttons are pressed
As mentioned in the Welcome to SPFLite, the the KEYMAP facility and mappable keyboard functions play an important role in providing many of the powerful features of SPFLite. IBM ISPF did not give as much emphasis to this, because 3270 keyboards only allowed for mapping of PF keys, whereas SPFLite can map almost anything. The time you spend learning about this facility will be well worth the effort.
It is important to remember that SPFLite Key Mapping only applies to the File Manager and Edit/Browse screens. Such screens are under the direct control of SPFLite, and so it is able to read and interpret keyboard scan codes and mouse activity according to how you set up your Key Mapping.
When you see "dialogs" that are under the management of Windows itself, SPFLite Key Mapping does not get involved. That is because, while SPFLite has requested such dialogs to appear, it is Windows itself that drives and handles such dialogs. SPFLite is only "notified" when the dialog is completed. Because of that, SPFLite does not see individual keyboard and mouse actions, and is in no position to interpret them using your Key Mapping definitions.
Thus, there are "two worlds" - the world of SPFLite and its Key Mapping definitions, and the world of Windows dialogs - and these two worlds never meet.
When Windows dialogs appear, you can only use keys as they are understood by Windows. So, when a "Enter" is required, you must press the key labeled "Enter", and not some other key mapped to (Enter), such as Right-Ctrl. Copy to clipboard must be done by Ctrl-C, paste from clipboard must be done by Ctrl-V, etc. Such Windows-managed dialogs include, for example:
- The KEYMAP dialog
- The File Rename and File Delete/Purge dialogs
- All of the dialogs in SPFLite Global Options (General, File Manager, Submit, Screen, Keyboard, Mouse)
- Message Box dialogs that may have been issued by an SPFLite macro
- SUBMIT messages
- Any debugging or program-exception dialogs that might appear
Murphy's Law suggests that at some point, somehow, you will end up with a messed up keyboard definition and need a way out. If you can still enter commands, then issue KEYMAP, and carefully check each suspicious key one at a time, until you find the cause of your problem. You can also see a list of every defined key mapping by using the KEYMAP LIST command, discussed below.
But what if you can't get into the Key Map? Read on.
You can start up SPFLite using a command line option -KEYMAP which will bring up the KEYMAP dialog. Once you close the KEYMAP dialog, SPFLite will start up normally.
Because this is a type of "emergency startup contingency", SPFLite will not have completely finished all of its initialization steps when you get to the KEYMAP dialog. As a result, the dialog will be displayed with a default font rather than your customary editing font. Don't worry about that for now. After you finish, and when SPFLite begins normal operation, the customary editing font will appear when you issue a KEYMAP command again.
See Starting and Ending SPFLite for more information.
This may be the simplest way, if you're just starting the key customization process. Just delete the SPFLite.KBD file from your SPFLite data directory (which is normally \My Documents\SPFLite). When you restart SPFLite, a new keyboard definition file with the standard defaults is recreated for you. If you do this, you will lose any keyboard customization you may have done, but at least when you restart, SPFLite will be usable, and you can try doing your keyboard customization afresh.
There seems to be two kinds of SPFLite users, as far as keyboard configuration goes:
- those who take the installation defaults, make a few minor changes, and let it go at that, and
- users that like to "go crazy", who frequently and heavily modify the KEYMAP settings (I am in that category - RH)
If you find yourself in the "go crazy" category (it's alright - we won't tell anyone !) you may wish to plan ahead in case you update your Keymap and then later wish that you hadn't. Just make sure that you have a backup copy (perhaps several) of the SPFLite.KBD file.
As long as you have a recovery plan, you should be ready for any eventuality. If you ever run into keyboard problems that you can't seem to fix, just copy one of your saved KBD backup files back to SPFLite.KBD, restart SPFLite, and you should be good to go!
In order to help you examine the contents of your entire "keymap inventory", you can issue the command KEYMAP LIST. When you do this,
- SPFLite gathers all known information about the mapping of every key
- It takes that information and formats it into a text file
- That file is stored into the Windows clipboard
- A CLIP Edit window is opened in SPFLite to allow you to examine the contents of your KEYMAP data
- Note: Only mapped keys will be in this list. Keys whose mapping string contain nothing but (NULL) will not be listed
Because you are in an SPFLite-controlled edit screen when this happens, you have available to you all the editing features of SPFLite, including the ability to FIND, SORT, EXCLUDE, and so on.
You can create a permanent file by issuing a SAVEAS command, or paste the data into an application outside of SPFLite.
The data you see can be changed in any way you like; changing it will not affect SPFLite's KEYMAP system. Only the KEYMAP dialog can do that. So, you can safely do anything you wish to this data.
Created with the Personal Edition of HelpNDoc: Free Qt Help documentation generator