PCKeyboard NAME PCKeyboard V1.2 - Keyboard commodity for use with Bridgeboard. LEGAL STUFF This program is freeware. Copyright © 1996 by Adrián Le Pera - All Rights Reserved. THIS PROGRAM AND ITS DOCUMENTATION MAY BE DISTRIBUTED FOR NON-PROFIT PURPOSE ONLY. IT MAY NOT BE MODIFIED IN ANY WAY WITHOUT THE PRIOR WRITTEN PERMISSION OF THE AUTHOR. USE AT YOUR OWN RISK. NO WARRANTY. NO REFUNDS. NO CARRIER. IT IS ILLEGAL TO DISTRIBUTE THIS PROGRAM ON DISKS WHICH COST MORE THAN US $5 PER FLOPPY DISK, OR MORE THAN US $50 PER CD. REQUIREMENTS - Workbench and Kickstart 2.04 or higher required. - Bridgeboard system using the Janus.library DESCRIPTION PCKeyboard is a commodity that allows the use of the Amiga keyboard for any of the Bridgeboards. The reason I wrote this commodity is that I was sick of not being able to use the right-alt key for the PC side. I tried using SXServ but the same problem persisted. Also, sometimes SXServ would loose some keypresses so I tried to do a better job. This commodity can send all keyboard input to a Bridgeboard. A hotkey combination is used to toggle which side (Amiga or PC) recieves the keyboard input. INSTALLATION Just put the commodity in anywhere in your sistem. You might want to put it in the WBStartup drawer so that it is loaded every time you boot up. USAGE From the CLI: PCKeyboard [options] For valid options look at the TOOLTYPES. From Workbench: Double-click on the PCKeyboard icon to launch it. If the commodity is already installed then if you double-click on the PCKeyboard icon will bring up a requester asking you if you want to quit (unload) PCKeyboard. Options can be specified by the TOOLTYPES. You can also use a commodity management program such as Exchange to enable/disable and remove the PCKeyboard commodity. TOOLTYPES The default operarion of PCKeyboard can be modified by the various tooltypes. DONOTWAIT Instructs the WBStartup file to continue processing without waiting for the commotity program to finish. CX_PRIORITY = Where is a number between -127 to 128. Select the cx_Priority of the commodity. The default is zero. If you want blankers to work properly (i.e. blank the screen when you are using the PC side) you must set the priority of PCKeyboard higher than that of the blankers. The same thing applies to FKey commodity and any other commodity that processes keyboard input. If you want them to ignore the keyboard while you are using it for the PC side then make the CX_PRIORITY of PCKeyboard the highest priority. CX_POPKEY = Where is any valid hotkey combination. This determines the hotkey for the commodity. When the hotkey combination is pressed, a requester is shown which allows you to quit (unload) the commodity. This provides for a fast way of removing the commodity. The default is LCOMMAND K. STARTPC = YES|NO Selects if the keyboard is assigned to the Bridgeboard on startup. If set to YES, the keyboard input will be redirected to the Bridgeboard when the commodity is launched. The default is NO. SWITCHKEY = Where is any valid hotkey combination. This option determines the hotkey used for toggling the keyboard input from the Amiga side to the PC side. The default is LCOMMAND X. I suggest that you use a combination that uses one of the command (Amiga) keys because these are the only keycodes which are never sent to the Bridgeboard. CODE = , This tooltype allows you to map any Amiga scancode to any PC scancode. You can have more than one entry for this tooltype and all of the entries will be considered. This allows you to adjust the keymap to your particular needs. The is a HEXADECIMAL number corresponding to an Amiga scancode value from 0 to 0x7f. The is a HEXADECIMAL number, corresponding to a PC scancode with range from 0 to 0xff. The range from 0x80 to 0xff is used to specify extended keyboard scancodes (see AMIGA_HELP, etc). AMIGA_HELP = ; Amiga Help key AMIGA_KSLASH = ; Amiga keypad / key AMIGA_INT1 = ; Amiga international keyboard, scancode 0x2B AMIGA_INT2 = ; Amiga international keyboard, scancode 0x30 Using any of this options you can assign a PC scancode to any of these four keys. As I have an American keyboard I am unable to try the international keyboard scancodes but the program works for the other two keys so it should work for the international keys. The option is a decimal number from 0 to 256. Normaly, a PC keyboard only sends scancodes from 0 to 127. The reason codes from 128 to 256 are valid is to implement the PC extended keyboard scancodes (where two or more bytes are sent). You can only send extended scancodes two bytes long, where the first byte is 0xE0 (224). The corresponding extended scancode is the second byte. The number that you would supply would be the second byte of the extended scancode added to 128 (0x80). Lets look at two examples: To assign the scancode value corresponding to the Alt key in the unexpanded PC keyboard (84 keys) to the Help key you would add the tooltype: AMIGA_HELP = 56 Where 56 is the scancode value of the Alt key in an unexpanded keyboard. To assign the scancode value corresponding to the Grey Home key in the expanded PC keyboard (101/102 keys) to the keypad slash key you would add the tooltype: AMIGA_KSLASH = 199 The PC scancode for the Grey Home key is the two byte sequence: 0xE0 0x47 (224 71). To tell the commodity that we want to send the extended keycode you must set bit 7 of the scancode. The rest of the byte contains the lower bits of the second byte of the extended scancode. What this amounts to is that, to send any extended two byte sequence where the first byte is 0xE0 (224) you add 128 to the second byte in the sequence. In this example, the corresponding scancode is 0x47+0x80=0xC7 (71+128=199). Note that, even though I wrote the scancodes in hex in the examples, the commodity only understands decimal scancodes. So, if you do your math in hex you have to convert the results to decimal. NOTES For how to have blankers work (blank the screen) see the CX_PRIORITY tooltype. You can play with the CapsLock key and get it to be at the wrong state for the PC side (ex: set CapsLock and then reset the Bridgeboard, the CapsLock will be lit but for the Bridgeboard it will not be set). There is currently no way around this but it shouldn't be a problem. Pressing the CapsLock will always toggle the CapsLock state in the PC side and it should work right all the time for the Amiga side. Also, I chose to assign the NumLock, ScrollLock and PrintScreen keys to the corresponding keypad keys, so that if you think that the keypad ( key is not working, you are really toggling the NumLock state of the PC. Important! All keys should work as always on the Amiga side. LIMITATIONS I wrote this version for myself and added the ability to choose some keycodes for other people who might have an international keyboard. However, I'm not shure if this is enough so if you have any special requests just send me some e-mail. Actually, I just added the CODE tooltype, so you should be able to setup each key individually. I'm thinking of adding a window and the ability to load keymap files from disk (not worth it, you can change scancodes using the CODE tooltype) which would allow people to choose their own mappings for all keycodes. However, I will not be working on this right now (maybe in a couple of months?). I believe that this commodity should work better than the SXServ commodity and PCWindow because I have buffered input and I'm using Bridgeboard interrupts to know when to send a new keycode. In this way, the program avoids loosing any scancodes without having to recieve timer events. BUGS I don't think so. In any case, let me know. AUTHOR If you have bugreports, questions, ideas, flames or complaints (constructive criticism is always welcome), or if you just want to contact me, write to: Adrián Le Pera Internet: slpapl@cup.portal.com RELEASE 09.Mar.96 v1.0 First release. 13.Mar.96 v1.1 Added CODE Tooltype (Had some spare time!). 28.Mar.96 v1.2 Fixed CX_PRIORITY Tooltype (didn't work) and potential crash on program exit.