Win95Key v3
1. About
This program is intended to assign actions on key pressing in OS/2 PM environment,
It allows to use Windows specific keys and multimedia keyboards as well. For example,
you can call WarpCenter menu by pressing Windows button or launch Mozilla by
pressing Ctrl-Shift-M. The program is written in the way that allows to assign
new actions easily and (for developers) to increase its functionality using plugin
scheme. Starting from version 3, the kbdfix utility is included in the
package. It allows to use keys that do not return correct scancode in OS/2 PM
and cannot be used in OS/2 in standart manner (e.g. Power and Sleep
buttons and some Multimedia buttons).
2. Installation
To install the program extract the archive into any directory and run REXX script
install.cmd. It will create "Win95Key" folder on your desktop. Brief
description of folder content:
"PM Conf Configuration program" |
- PM program for Win95Key configuration |
"Win 95 Key" |
- the program :-) |
"Tools" |
- utilities that can be useful (see below) |
"src" |
- source code of the project |
NB: installation of Win95Key over existing old version
can cause problems and therefore is not recommended.
3. Configuration
Run PM Conf program to configure Win95Key. You can do this from Win95Key folder
or by pressing Ctrl-Shift-S (Win95Key must be launched).
3.1 PM Conf possibilities
PM Conf allows to:
- show assigned key combinations, edit them and add new combinations;
- edit parameters of plugin assigned to key combination (plugin description is taken from its resources);
- support drag&drop (e.g. in the OpenObject plugin);
- turn on and off plugins from external libraries;
- edit and assign scancodes for special keys (modifiers), e.g. LWIN;
- select multimedia keyboard model (from keyboard.def file) to show all scancodes as names correctly.
- reload Win95Key settings.
3.2 Adding actions
After program launch you will see the "Hotkeys" tab. In this tab you may view the list of assigned
key combinations and the actions assigned to these combinations.
To add new combination you have to:
- Enter the key scancode or its name (e.g. "F") in the "Code" input field.
- Select modifiers (e.g. Ctrl and Shift) for this key in the "Modifiers" field.
Modifiers can be added or changed in the "Settings" tab. Do not mark any modifiers
if you want to use scancode without modifiers.
- Select plugin that you want to assign to this key combination in the "Plugin" window
and press the "Settings" button. Plugins can be added or removed in the "Settings" tab.
To edit a key combination select it in the "Hotkey" list, modify settings and
press "Change button"
To remove a key combination select it in the "Hotkey" list and press the "Remove" button.
To apply the changes you have made press the "Apply" button.
3.3 Adding/removing plugins
If you want to add a plugin press the button "Add new" in the plugin section of the "Settings" bookmark. Then in the dialog window press the "Locate" button and choose the DLL with plugins.
In the "Add plugin" window there appears the plugin list stored in the chosen library.
and press the "Add" button. After this the selected plugins will appear in the "Function" window.
To delete a plugin select it in the "Function" window and press the "Remove" button.
3.4 Adding modifiers
The "Modifiers" section describes the keys that are used in addition to standart
"Ctrl", "Alt" and "Shift" modifiers. To add a modifier press the "Add new" button
in the "Modifiers" section. Enter the scancode of the modifier and its name.
New modifier will be available in the "Hotkeys" tab for adding new key combination.
To remove or edit modifier select it in the "Modifiers" window and press the "Remove"
or "Edit" button.
3.4 Changing Win95Key parameters
The "Global" section in the "Setting" tab contains 3 options that affect Win95Key's operation.
The "Immediately key reaction" option is responsible for program reaction on key pressing.
If it is enabled, reaction takes place immediately after the corresponding keys were pressed.
If it is disabled, reaction takes place after the corresponding keys were released.
If the "run minimized" option is enabled, Win95Key will be run minimized next launch.
If the "hide in tasklist" option is enabled, Win95Key will not be shown in the OS/2 Window List.
You must press the "Apply" button after setup of these parameters.
4. KBDfix utility
OS/2 does not recognize some keys on modern keyboards correctly. Win95Key
cannot use these keys (e.g. "Power" and "Sleep"). KBDfix utility was written
to provide a workaround for this system bug.
4.1. Determing the scancode of "dead keys"
If your keyboard has some keys that are not recognized by PM Conf program
and you want to use these keys in OS/2, you have to find out their scancodes that are
returned by keyboard driver. To do this, launch "Keyboard DosMon* tester" from
the Win95Key —> Tools folder. After launch of the program
press the keys that do not work in OS/2 and write down their scancodes (scan=xxx).
Then open file kbdfix.cfg and add lines like Key=xxx to this file
(xxx is the scancode for corresponding key). The number of these lines is not limited.
By default kbdfix.cfg contains records for "Power" and "Sleep" keys already.
4.2. Starting up daemon
To launch KBDfix at system startup edit your config.sys file.
Add a line like the following:
RUN=D:\apps\Win95Key\bin\kbdfixd.exe
(sure the correct path should be specified :) and reboot OS/2.
4.3. Usage
The keys listed in kbdfix.cfg file must be recognized correctly
after system reboot. Edit kbdfix.cfg and run the
"Reload KBDfixD configuration" utility from Win95Key –> Tools
folder to change KBDfix configuration without system reboot.
NB!
If this utility appears to be really useful to you, send your kbdfix.cfg file
to samm@os2.ru, I will add your scancodes
to standart package subsequently.
5. Win95Key plugins
At present Win95Key package contains several plugin libraries. Plugin library
is a DLL with functions that can be assigned as action on key pressing. This section
contains brief description of plugins and examples of plugin usage.
5.1 w95k_std.dll library
- SwitchTo - switches to the task specified.
With this plugin one may call the required window. If more than one window match
the pattern, they will be switched cyclically.
Search pattern can be specified in two ways:
- simple way: "string1|string2|string3|string..."
This will search for windows with title that contains string1 or string2 or string... .
If stringI looks like *text then "text" substring is searched in window title.
If stringI looks like text (no leading asterisk) then the beginning of window title
is compared with "text" (i.e. window title must begin with "text" to match).
Limitation: first symbol of window title can not be '/' (this is explained at point 2)
- using regular expressions: "/string" (search pattern starts with '/')
All window titles that match the search pattern are searched in this case.
PCRE library is used for regexp implementation.
- WindowList - calls OS/2 Task List.
- DesktopMenu - calls context menu of Desktop. The name of your desktop
is an optional parameter.
- WarpcenterMenu - plugin for operations with WarpCenter.
This plugin allows to operate WarpCenter using keyboard.
- MENU - calls "OS/2 Warp" menu of WarpCenter
- WINDOWLIST - calls Window List
- LOCKUP - calls OS/2 Lockup
- FIND - calls WarpCenter Search
- SHUTDOWN - OS/2 Shutdown
- INFO - swithes WarpCenter indicator
- TRAYS - changes current tray
- CLOCK - switches WarpCenter clock
- PROPERTIES - calls WarpCenter properties
- OpenObject - opens WPS object or launches a program.
The name of the program (e.g. d:\os2\e.exe) or WPS object
(e.g. <WP_SYSTEM>) must be specified. Also run parameters
must be set. Acceptable values are: DEFAULT, HELP, PALETTE, PROMPTDLG, RUNNING,
SETTINGS, TREE, CONTENTS, DETAILS
- Volume - manages main volume control.
You need to specify method (0 - MMOS2 MCI, 1 - LIBMIX PIPE API, 2 - WPS "Volume" object)
and action UP , DOWN or MUTE.
- MinimizeAll - minimizes all windows.
Exceptions may be specified with comma delimiter.
5.2. w95k_od.dll library
SwitchToVirtualDesktop - changes active desktop in the Object Desltop program.