Why keyboard layouts are important

Assuming that CAPS LOCK is turned off, if you need to type the string 'Hello'. You need to press the following key sequence: SHIFT+H, E, L, L, O. Similarly special characters like !, #, $, :, " etc need special treatment.

The keyboard layout determines how these characters are typed on the keyboard. A SHIFT+3 on a UK keyboard represents a '#' while on a UK keyboard it represents a '£'.

How do you define your own keyboard layout ?

To define your keyboard layout either:

set the system property "org.eclipse.swtbot.keyboard.layout" OR

set the variable SWTBotPreferences#KEYBOARD_LAYOUT

The value of this property should be of the form foo.bar.baz.[MAC.][upper-case-two-character-country-code]. For e.g. com.foo.bar.US or com.foo.bar.MAC.FR. The prefix ".MAC" is required for macosx keyboard.

Once you've defined the property, it is required to define the keyboard layout. For this purpose you need to create a config file called [MAC.][upper-case-two-character-country-code].keyboard in the package com.foo.bar.baz. For e.g. com/foo/bar/US.keyboard or com/foo/bar/MAC.FR.keyboard.