# Onboard - Layout creation

### 3.1 Basic Layout Personalisation

Open the settings dialog. Select the layout you want to personalise and click "Personalise this layout". Type the name of your new layout. A file browser window will now open showing your layout folder. Open the .svg file you want to change with a vector graphics package. I recommend Inkscape which is free. You can move the keys, change their width, height and colour.

To move a key from one pane to another, right click on the key and click object properties. Note the id of the key. Either create a new rectangle on the other pane or use an existing one. Bring up the object properties and change the id to that of the key you want it to be.

### 3.2 Creating a layout from scratch and advanced layout personalisation

Layouts are composed of one .onboard file and one or more .svg files. The .onboard file contains all the settings for each pane and properties such as label and action but not the location of each key.

Each svg file contains the placement of each key on the plane. I recommend you use a vector graphics package such as inkscape to create or modify these files. Keys can be rectangles or paths (straight lines or bezier curves) though Onboard only detects clicks quite approximately around curves. The id of each object in the svg file corresponds to a key in the .onboard file with the same id. Set the id in Inkscape by right clicking on the object and selecting object properties.

The .onboard file contains pane and key objects. It is in XML format. Each pane object has:

- Each part of the colour of the pane.
  - backGroundRed = "number"
  - backGroundGreen = "number"
  - backGroundBlue = "number"
  - backGroundAlpha = "number"
- The font size
  font = "number"
- The id
  id = "name"
- The name of the corresponding svg file within the folder
  filename = "name"

Each key object has:

- The id that corresponds with that in the svg file.
  id = "name"
- Whether the key sticks in the manner that modifiers do in the default layout.
  sticky = "true/false"
- The default label on the key.
  label = "name"

It can also have:

- The label for when caps lock or shift is pressed
  cap_label = "name"
- The label for when only shift is pressed
  shift_label = "name"
- The label for when alt gr is pressed
  altgr_label = "name"
- The label for when alt gr and shift is pressed
  altgrNshift_label = "name"
- The x label offset mainly needed for non-rectangle keys
  font_offset_x = "number"
- The y label offset
  font_offset_y = "number"

It must have one of:

- The character written when key pressed.
  char = "character"
- The keysym or the physical key being emulated in decimal or hex if prefixed by 0x.
  keysym = "number"
- Name of emulated keys see list below.
  press = "name"
- The macro number starting from 0 that the key corresponds with.
  macro = "number"
- The name of the script which is ran when key is pressed.
  script = "name"
- The name of the modifier which key emulates. It is recommended to have the sticky attribute set to true for modifiers. List of modifier names given below.
  modifier = "name"

List of names that can be paired with the modifier attribute of key:

- shift
- caps
- control
- mod1 (alt)
- mod2
- mod3 (num lock)
- mod4
- mod5 (alt gr)

List of names that can be paired with the press attribute of key:

- space
- insert
- home
- page_up
- page_down
- end
- delete
- return
- backspace