APPLICATION NOTE #196 TESTING NEW KEYBOARDS Rev. 01 XyWrite's keyboard files are written to conform to the standards established by IBM Corporation for 104-key keyboards. Other keyboard manufacturers might construct their keyboards a bit differently or provide more than 104 keys. This application note explains how to use a test file to determine the best way to use your keyboard with XyWrite. Key Numbers and Key Definitions Every key on a keyboard is assigned a key number by the manufacturer. When you press a key, the hardware sends a message to XyWrite telling it what key number has been pressed. XyWrite checks the keyboard file you are using to see what it is supposed to do when you press that key. Therefore, having the proper definitions attached to the proper keys is very important. For example, key number 30 is normally assigned to produce an "a" if you press it and no other key (shift, control, etc.). But if you change the definition attached to key number 30 in your keyboard file, you can have key number 30 do anything you want. However, the manufacturer of your keyboard may have given the "a" key the number 40 instead. This means you must adjust your keyboard file so that key number 40 tells XyWrite to produce an "a," not key number 30. Determining Key Numbers XYQUEST provides a special keyboard file, TEST.KBD, to help you determine the numbers your keyboard associates with each key. To use TEST.KBD: 1. Load TEST.KBD into memory as you do any keyboard file. For example: F5load test.kbd 2. Press Ctrl and the key whose number you want to determine. XyWrite displays a message on the command line, telling you that key's number. For example, if you are using a standard keyboard and you press Ctrl A, XyWrite responds: key 30 Once you have determined the numbers your keyboard uses for each key, you can make the corresponding assignments in your XyWrite keyboard file. Both the XyWrite III Plus Reference Guide and the Applications Tutorial contain detailed information on customizing your keyboard file. Shift Level of Cursor Keys Some keyboards (especially laptop computer keyboards) do not distinguish between the shift and unshift level of the cursor keys. This can cause problems if you want to use XyWrite's Column Table feature, which normally uses the shift level of the cursor keys for navigation. To determine if your keyboard can distinguish between shift and unshift, press Ctrl Shift and each key. If the keyboard can tell you have pressed Shift, it responds: key 80 shifted If it cannot tell that you have pressed Shift, it responds: key 80 If this is the case, in order to use the Column Table feature you must move the functions associated with column tables to another location in your keyboard file. See Chapter 6 of the XyWrite III Plus Reference Guide for more information on customizing your keyboard file. Extended Keyboards When PC keyboards were first designed, they had 84 keys. The so-called extended keyboards that came along a bit later added several more function keys and a set of cursor keys separate from the numeric keypad. Some keyboard manufacturers chose to assign unique key numbers to these additional cursor keys; others chose to simply use the same number as the key's counterpart on the numeric keypad. Therefore, it is especially important to check the key numbers for the additional cursor keys. You might find, for example, that both cursor down keys (normally, keys number 80 and 102) are assigned key number 80. Note #1 When to Use TEST.KBD. The testing process described in this application note is only necessary if you are having problems using your keyboard with XyWrite. Most non-IBM keyboards for PCs conform to IBM standards. Note #2 Keyboards with More Than 120 Keys. If your keyboard has more than 120 keys, call Technical Services for information on modifying TEST.KBD.