Home > Customization (Skins) > Remapping Keys

Remapping Keys

In the kiosk industry, public terminals are often used with special hardware keyboards with special features which can be executed.
It is for example possible to implement a keyboard that, in contrast to a conventional keyboard modifier key "http://" or additional scroll buttons. SiteKiosk makes available, for example an F4 key with the "scroll down".
1. How it Works
Once you have defined a corresponding definition file (.Xml), whenever SiteKiosk runs, the keystrokes are diverted according to your definition. When you exit SiteKiosk, the keyboard goes back to normal operation.
You can define any number of hot keys. A hotkey is a combination of a normal key (as specified Virtual key code) and zero or more modifier keys. Modifier keys are Shift, Ctrl, Alt and Windows logo key. In addition, each hot key assigned to a sound file that can be played when the key is triggered.
1.1 Automatic Creation with the Keyboard Remapper
Starting with version 6.2, a tool is supplied with SiteKiosk, which helps you with remapping the keys and activating the created definition file. You can find the keyboard remapper tool in the Windows Start menu, under START / PROGRAMS / SITEKIOSK / TOOLS.
1.2 Manual Creation and Activation
Alternatively, the file can be created manually using an editor like Notepad and is activated by you with an entry in the Windows registry.

1. Install the full version of SiteKiosk on your computer.
2. Create a file with the extension .xml that contains your key definitions.
3. Use the registry editor (i.e. regedit.exe) at the key HKEY_LOCAL_MACHINE\SOFTWARE\Provisio\SiteKiosk
   (Windows 64 Bit: HKEY_LOCAL_MACHINE\Software\Wow6432Node\PROVISIO\SiteKiosk) to create a string value with the name "HotKeyFile" and enter the data as the full path to the hot key definition file (i.e. "C:\Program Files\SiteKiosk\Bitmaps\Sample.xml") ein.

2. Structure of the Definition File
In the definition file hotkeys are defined with the desired functions. The file can contain one or more hotkey definitions. A hotkey can get assigned to a particular type of action or a macro.
2.1 Hotkey Types
The type of a hotkey sets the action to be executed. A hotkey must be assigned to a virtual key code that determines the key to be pressed to trigger the hotkey action.
The following hotkey types are available:

0 Individual key or macro (default)
(defined with the help of a Virtual Key Code)
3 (Scroll) Left
4 (Scroll) Right
5 (Scroll) Up
6 (Scroll) Down
8 (Scroll) Back
9 (Scroll) Forward
10 (Browser) Stop
11 (Browser) Refresh
12 (Browser) Start Page
13 (Browser) Print Page
14 (Browser) Search
16 (Browser) Call URL
17 (Skin) Fire Hotkey Event

2.2 Virtual Key Codes
The Virtual codes must be specified in decimal and are removed from the documentation for Windows Platform SDKs. You can use the virtual key codes with the free tool virtkeys.exe.
Here are some examples of virtual key codes, please note that F12 is reserved and can not be used:

VK_F1 112
VK_F2 113
VK_F3 114
VK_F4 115
VK_F5 116
VK_F6 117
VK_F7 118
VK_F8 119
VK_F9 120
VK_F10 121
VK_F11 122
etc...

2.3 Defining Sounds
For each defined hotkey, a sound can be played. If no sound is played, the sound attribute can easily be omitted.

<sound id='0'>mysoundfile.wav</sound>

The index (id='index number') is an actual array index - therefore should be started at 0 and are incremented sequentially without gaps.
Important:
The path to the sound file MUST be specified relative to the SiteKiosk directory.
2.4 An Example File
The example below defines various keys and what happens when they are pressed.

<hotkeys>
<sound id='0'>wavs\mysoundfile.wav<sound/>
<sound id='1'>wavs\mysoundfile2.wav<sound/>
<sound id='2'>wavs\mysoundfile3.wav<sound/>
<hotkey type='3' vkey='112' sound='0' alt='0' control='0' shift='0' windows='0' />
<hotkey vkey='113' sound='1'>
<key char='a'/>
</hotkey>
<hotkey vkey='113' sound='1'>
<key char='B'/>
</hotkey>
<hotkey vkey='114' sound='2'>
<key char='h'/>
<key char='t'/>
<key char='t'/>
<key char='p'/>
<key char=':'/>
<key char='/'/>
<key char='/'/>
</hotkey>
<hotkey type='16' vkey='115' sound='0'>
<url>http://www.sitekiosk.com/</url>
</hotkey>
<hotkey type='17' vkey='122' sound='0'>
<name>MyHotKeyEventName</name>
</hotkey>
</hotkeys>

Below are explanations of each point in the sample file.
Example of a Hotkey action:

<hotkey type='3' vkey='112' sound='0' alt='0' control='0' shift='0' windows='0' />

With input from keyboard "F1" (vkey='112') is the "SCROLL LEFT" run (type='3') and the sound "mysoundfile.wav" played (sound='0', sound with id ='0' will be played).
Additionally, you can turn on system keys (modifiers) that are then pressed in combination with F1 would (in this example, all modifiers are off):

- alt: ALT key (change: Value=1 instead of 0)
- control: CTRL key (change: Value=1 instead of 0)
- shift: SHIFT key (change: Value=1 instead of 0)
- windows: Windows key (change: Value=1 instead of 0)

Example of remapping a single key:

<hotkey vkey='113' sound='1'>
<key char='a'/>
</hotkey>

For keyboard input of "F2" key "a" is generated as input. If in the definition wrote 'A' instead of 'a', a big "A" are generated.
Example of a Macro:

<hotkey vkey='114' sound='2'>
<key char='h'/>
<key char='t'/>
<key char='t'/>
<key char='p'/>
<key char=':'/>
<key char='/'/>
<key char='/'/>
</hotkey>

For keyboard input of "F3" then "http://" is produced as input.
ESC Key Remap:

<hotkey vkey='115' shift='1'>
<key vkey='27' />
</hotkey>

Usually you can call the password entry dialog within SiteKiosk using the ESC key. Here's a way how to call ESC by other means. Using SHIFT + F4 here calls ESC.
Define a link:

<hotkey type='16' vkey='155' sound='0'>
<url>http://www.sitekiosk.com/</url>
</hotkey>

When keyboard input of "F4" is entered then the following link is called automatically http://www.sitekiosk.com. This is probably the most interesting feature because can link directly to advertisers from a key press.
A Hotkey triggered event in SiteKiosk:

<hotkey type='17' vkey='122' sound='0'>
<name>MyHotKeyEventName</name>
</hotkey>

When you press "F11" an event is fired in SiteKiosk which can react to the SiteKiosk Object Model. Here is a simple example that writes the name of the hotkey pressed in the SiteKiosk log file:

SiteKiosk.LocaleManager.OnHotKeyPressed = OnHotKeyPressed;
function OnHotKeyPressed(hotkeyname)
{
SiteKiosk.Logfile.Notification("Hotkeyname: " + hotkeyname);
}

See also

Manually Configurable Options
Language Files
SKSKIN File
Browser Layout
Keyboard Layout
Start Page Layout

Back to top