Virtual OS/2 International Consumer Education
VOICE Home Page: http://www.os2voice.org
April 2002

[Newsletter Index]
[Previous Page] [Next Page]
[Feature Index]

editor@os2voice.org


Making all those extra keys work under OS/2!

By Niels Jensen © April 2002

The IBM Aptiva S-36, which I acquired more than three years ago, came with an IBM Rapid Access Keyboard, as shown to the right. This meant, than in Windows 95 I could

and some other things with dedicated Windows 95 applications, that I didn't bother to learn about. As an OS/2 user I could until recently just stare at these button, and the so called windows keys. However, now the situation has changed thanks to a number of freeware utilities, and in this how-to I will explain how I have the above functionality available under OS/2.

In order to use the so called rapid access keys three things must happen:

  1. The keys must generate a scan code, when pressed.
  2. There must be software, which act on these scan codes. i.e. starts a program, displays a window etc.
  3. There must be a method of specifying the action, i.e. associating a specific key or key combination with the start of a particular program or other action.
These task are performed by the following freeware utilities:
You can download all the needed software free of charge from the locations given at the end of this article.

Installation of IBM Rapid Access Keyboard I Enabler

The IBM Rapid Access Keyboard I Enabler, which generates scan codes for the above when the rapid access keys are pressed, is installed by copying the ibmra1.sys file to your OS/2 boot directory, e.g. C:\OS2\BOOT\, and adding the following line to your config.sys file:

DEVICE=C:\OS2\BOOT\ibmra1.sys

and then rebooting the system. Now all the extra keys will generate scan codes, and the next step is to install software to take action on those scancodes, i.e. Win95Key and PMConf.

Installation of Win95Key and PMConf

Win95Key and PMConf are installed by unraring the downloaded file in a directory of your choice, e.g. D:\APPS\WIN95KEY\. I used rar203.exe, which I found on Hobbes (http://hobbes.nmsu.edu/) for this task. This is a DOS program, so you cannot execute it from a directory, which contain long directory names on the path, e.g. F:\Applications\rar203.exe, and the unrar.exe program contained in this archive is also a DOS program. Version 2.11 of Win95Key appears not to be available as a zip-file, so you either have to find an unrar utility on Hobbes or use the add-ons, which comes with WarpZip. After unraring the archive you run the install command file, which will create a Win95Key folder on your Desktop. You properly would want to create a shadow of the Win95Key program in your startup folder.
[Editors note: There is also an OS/2 version of RAR available on hobbes: http://hobbes.nmsu.edu/pub/os2/util/archiver/rar250p.exe which doesn't have the path or file name problem. Though RAR itself is shareware, the unRAR utility is freeware.]

Configuration of Win95Key

The Win95Key comes with certain keys already pre configured. For example the left windows key is equivalent to clicking the OS/2 Warp icon in the WarpCenter, and the right windows key brings up the Window List for easy switching between active programs. At present the only way to discover what different key combinations do is to run PMConf and look through the pre-assigned key combinations. You can off-course change these to suit your own habits or delete the once, which you don't like.

To configure the extra keys on the IBM Rapid Access Keyboard you run PMConf and click on the Hotkeys tab, if it is not already in front. The you press the Get code button, which will display a small window on your desktop until you press the key you want to configure. For example to configure the key, which IBM has labeled 'Lotus WordPro' you perform the following steps:

  1. Run PMConf, while Win95Key is not running.
  2. Click on the Hotkeys tab.
  3. Click on the Get code button.
  4. Press the keyboard button, which you want to configure, i.e. 'Lotus WordPro'. On my system this key has scan code 199, which then appears in the Key ScanCode window.
  5. Select the plugin type from the plugin pull-down menu. In this case you want to select OpenObject.
  6. Press the settings.... This will bring up another configuration window in which you can enter the complete path to the object. The path may also be entered using drag&drop. Finally select the type of action, i.e. running.
  7. Press the hotkey Add button.
  8. Repeat the above steps 3-7 for any other keyboard buttons, which you would like to configure.
  9. Start Win95Key, and press the Apply button in PMConf.
I have configured the following: 'Help' opens the assistance center folder, 'Internet' starts InJoy Dialer 2.3 and connects to the internet, 'Lotus WordPro' and 'Lotus Organizer' starts the indicated programs, and finally 'Aptiva Installer' start the Cinema/2 TV application. However, the CD manipulation buttons where still sitting there more or less useless until I discovered the CD Player for WarpCenter.

Installation of CD Player for WarpCenter

The CD Player for WarpCenter is a rexx based application, which during installation creates a new tray in your WarpCenter labeled 'CD-Player' and inserts icons for power on, rewind, play, forward, pause, stop, intro play and eject plus volume on the new tray. The installation of the CD Player is done by unzipping the downloaded zip-file in a temporary directory and running the included install program. The install program will copy the program files to a directory of your choice, create the extra tray on WarpCenter and populate this with icons with the indicated functions. The CD Player for WarpCenter looks like this


The engine behind the WarpCenter CD Player is two rexx programs: power.cmd and wccdcl.cmd. The first one starts a CD-server, and the second performs the actions: play, pause, forward, rewind, intro play and stop, depending on the command line keyword supplied. Unfortunately, I have been unable to use Win95Key and PMConf to run a rexx program by pressing a button on the keyboard, but this is where Dennis Bareis REXX compiler comes to the rescue.

Integration of CD Player for WarpCenter with Win95Key

Using the rexx compiler one can convert the rexx program to an exe-file, which can then be assigned to a button on the keyboard. The r2e99349 zip-file contains only to files: the program for conversion of rexx command file to exe-files, REXX2EXE.EXE, and a help file in OS/2's inf-format. The rexx compiler is used as follows:

REXX2EXE.EXE <rexx-program.cmd> <rexx-program.exe>

with some optional command line switches, which are described in the help file. To use the compiler copy the exe-file to a location on the libpath-statement in config.sys, e.g. C:\OS2\APPS\. The conversion of the power.cmd rexx-program is done this way:

REXX2EXE POWER.CMD POWER.EXE

from the WCCD2B directory. The next step is to convert the WCCDCL.CMD file to four files: PLAY.CMD, SKIP.CMD, BREAK.CMD and BACK.CMD in which the command line argument of WCCDCL.CMD is hard coded into the files. After conversion the PLAY.CMD files looks as follows:

/* Client v1.4 */

/* arg sendstring */

/* NJ20020210 Above commented out to make it work with Win95Key */

/* In lineout statement replaced sendstring with 'PLAY' */

rc = RxQueue(create, c_d_s_e_r_v_e_r)

If rc \= "C_D_S_E_R_V_E_R" then

do

call RxQueue "DELETE", rc

rc = RxQueue(set, c_d_s_e_r_v_e_r)

rc = lineout('Queue:', 'PLAY')

end

else call RxQueue "DELETE", rc

exit

which is then converted to programs in the same way as the POWER.CMD file. Thus you end with five programs: POWER.EXE, BREAK.EXE, PLAY.EXE, BACK.EXE and SKIP.EXE, which can then be assigned to the CD manipulation buttons on the IBM Rapid Access Keyboard I in the same fashion as described above. I also configured CTRL+ARROW UP to increase the sound level, and CRTL+ARROW DOWN to decrease it.

As a finishing touch the properties of the five programs are opened, and session status is changed to 'Start minimized'. Otherwise you will get a flashing OS/2 window on the screen each time you press one of the buttons on the keyboard. PMConf also have a start minimized button, but this is a global setting, and you properly don't want Lotus Organizer or Lotus WordPro to start minimized, when you press the rapid access keys assigned to them.

How I am using the Software

The software described here have allowed my to finally get full multimedia functionality under OS/2. The IBM Rapid Access Keyboard, which I use have a layout of the rapid access buttons, as shown below.

Currently my system is configured, so the Help key (blue) displays the OS/2 Assistance Center, the Internet key connects to my ISP using In-Joy, the Lotus Word Pro key and the the Lotus Organizer key are of course used to start those programs. Aptiva Installer starts Cinema/2, which is another freeware program, that displays TV on your OS/2 desktop (Note: Cinema/2 will not work if you have the comet cursor turned on). The four grey quarter circle keys are configured to respectively start, stop, forward or rewind the WarpCenter CD-Player, and the button in the labeled 'CD' of course starts playing the CD, which currently in the CD rom drive. Finally the Msg button starts my preferred e-mail program, which is Polarbar Mailer. The Talk and Delete Message buttons could be used to in a voice response system. As far as I know eComStation comes with an API, which could be used in such an application.

Bart van Leeuwen indicated in an e-mail exchange some time ago, that he would like to also get the LED's on the IBM Rapid Access Keyboard work. One of these are labelled 'Msg'. I believe, this would allow one to e.g. have an LED turn on whenever a new e-mail is received, which would be a nice feature for those, who are on ADSL.

I have previously without success attempted to get the ibmra1.sys driver to work with XWorkplace, which also has the ability to associate specified action with certain key or key combinations. Currently I don't have XWorkplace installed on my system.

There is a newer version 2.30 of Win95Key available at the os2.ru web-site. However, it take a bit of fiddling around to use the WIN95KEY.INI from version 2.11 with the new version, and as far as I can see it simply solves a problem with the renaming of WarpCenter in eComstation.


Niels Jensen is an associate professor at the Department of Chemical Engineering at the Technical University of Denmark, where he has been using OS/2 for all task in a sea of Windows since OS/2 version 2.11. The Department has used OS/2 since version 1.3 to run an industrial scale destillation pilot plant with heat integration. Niels primary research interest is process safety and in this connection the development of platform independent tools.


References:

Win95Key including PMConf (w95k230.rar) from http://os2.ru/projects/win95key/index.phtml.en
IBM Rapid Access Keyboard I Enabler (ibmra1.zip) from http://hobbes.nmsu.edu/cgi-bin/h-search?key=ibmra1.zip
Rexx Compiler (r2e99349.zip) from http://www.labyrinth.net.au/~dbareis/index.htm
CD-Player for Warp Center (WC_CD_2b.zip) from http://www.subsys.de/
rar203.exe (DOS version)from http://hobbes.nmsu.edu/cgi-bin/h-search?key=rar203.exe
rar250pexe (OS/2 version)from http://hobbes.nmsu.edu/pub/os2/util/archiver/rar250p.exe


[Feature Index]
editor@os2voice.org
[Previous Page] [Newsletter Index] [Next Page]
VOICE Home Page: http://www.os2voice.org