Replace the character typed by a key of the layout. Francesco Fumanti francesco.fumanti@gmx.net 2016

This work is licensed under the GNU General Public License version 3 or any later version.

Replace character of key

The following explains how to replace the character typed by a key of a layout shipping with Onboard.

Start by creating a copy of the layout that you want to modify. You can do it for example by following the instructions.

Open the svg files that were created by copying the layout with the Inkscape application.

Locate the key you want to edit on the images opened in Inkscape.

Click on the key and open the Properties pane of the object in Inkscape to get the id of the key.

Open the .onboard file, that was created when you copied the layout in the first step of these instructions in a text editor. It is located alongside the svg files that you opened to get the key id.

Locate the <key ... /> containing the id you determined by using the svg files.

Keep the id attribute of the key and edit the group, char, label and tooltips attribute according to your needs. Here is for example the definition of a key typing the smiling face emoticon:

<key group="symbol" id="EM01" char="☺" label="☺" tooltip="Smiling face" />

Meaning of the attributes:

group

This group attribute is related to the themes. The colour Onboard uses to display the key for example depends on the group, it belongs to.

id

The id attribute relates the definition of the key in the .onboard file to the key in the corresponding svg file.

char

The char attribute defines what gets typed by clicking on the key.

label

The label attribute defines what Onboard shows on the on-screen keyboard for the key.

tooltip

The tooltip attribute defines the text of the tooltip shown when the pointer hovers over the key.

By using the char attribute in the key tag the character typed by the key is fixed. Instead of using the char attribute, you can also use the keysym attribute. It behaves like the char attribute, but expects the numerical value of the char in decimal or hexadecimal format.

Finally, there is a third attribute to define what the key types. By replacing the char or keysym attribute with the keycode attribute which receives a numerical value in decimal format, the character typed is not fix anymore. In fact, the keycode identifies a keyboard key of the system and what gets typed depends on the keyboard language configured for the desktop session.

You might have a look at the key_defs.xml file shipping with Onboard for more information.