Skip to content

File formats

Tanamr edited this page Apr 15, 2023 · 8 revisions

Layouts

An example layout file (colemak_ca_ansi) is shown below.

fingermap: ansi_angle
q w f p b j l u y ;
a r s t g m n e i o '
x c d v z k h , . /

The keys in the layout are separated using single spaces. If multiple spaces appear, the key(s) that would have been between the spaces will be skipped.

Double slashes // in the file can be used to delineate comments; anything from a // to the end of the line will be ignored by trialyzer.

Additional specifications may be given on their own lines, which will not be taken as part of the layout. These options are:

  • fingermap: Specifies the name of a fingermap found in /fingermaps/, which will be used for the layout. Defaults to traditional if not given.
  • board: Specifies the name of a board found in /boards/, which will be used for the layout. Defaults to ansi if not given.
  • first_pos: Specifies the position of the first key in the layout. The format for this is first_pos: ROW col. Defaults to TOP 1 if not given.
  • special: Specifies a rule to use when processing the corpus, such as for assigning special shift behavior. The format is special: corpus_string key1 [key2 [...]]. When the specified corpus_string is encountered in the corpus, it will be replaced by the specified key sequence. Default values include A being replaced with shift_key a, and so on, if a shift key is included in the corpus processing settings. Currently, corpus_string cannot contain whitespace or //. Longer corpus_strings take priority over shorter ones.
  • repeat_key: Assigns a key to be used as a repeat key, which is a key that acts as another of whatever the last key before it was. These are sometimes discussed in layout analysis as a way to avoid having to press a key multiple times consecutively with the same finger, so I added them as a way to see if they're any good. It turns out they are!
  • If shift or space are specified in the layout, they will be used instead of the shift_key or space_key in your user settings. (Unless you've told trialyzer not to analyze shift or space, which is done by setting those rules to empty strings.)

A key may not appear more than once in the layout.

Fingermaps

An example fingermap (ansi_angle) is shown below. The format is very similar to the constraintmap specification.

LP LP LR LM LI LI RI RI RM RR RP RP RP RP
LP LP LR LM LI LI RI RI RM RR RP RP RP RP
LP LP LR LM LI LI RI RI RM RR RP RP RP
LP LR LM LI LI LI RI RI RM RR RP RP
LP  LT LT RT RT

A finger is specified for each key. Keys are separated using single spaces. If multiple spaces appear, the key(s) that would have been between the spaces will be skipped. Layouts do not need to use every key specified in the fingermap. Conversely, keys not specified in the fingermap will be assigned to a finger called UNKNOWN.

Double slashes // in the file can be used to delineate comments; anything from a // to the end of the line will be ignored by trialyzer.

Additional specifications may be given on their own lines, which will not be taken as part of the fingermap. These options are:

  • first_pos: Specifies the position of the first key in the fingermap. The format for this is first_pos: ROW col. Defaults to NUMBER 0 if not given.

Boards

An example board (ansi) is shown below.

NUMBER 0 0.0 4.0 13
TOP 0 0.5 3.0 13
HOME 0 0.75 2.0 12
BOTTOM 0 1.25 1.0 11
THUMB 0 0.5 0.0 1 // ctrl_l, win_l
THUMB 2 3.0 0.0 // alt_l
THUMB 3 5.0 0.0 // space_l
THUMB 4 7.5 0.0 // space_r
THUMB 5 10 0.0 // alt_r
THUMB 6 11.5 0.0 8 // win_r, menu, ctrl_r

default_key: BOTTOM 0 shift_l
default_key: BOTTOM 11 shift_r
default_key: THUMB 4 space_r
default_key: THUMB 2 alt_l

Double slashes // in the file can be used to delineate comments; anything from a // to the end of the line will be ignored by trialyzer.

Each line in the specification describes the physical coordinates of one or more keys. Layouts and fingermaps do not need to use every key specified in the board.

The format of each line is ROW col x y col2.

  • ROW and col specify the position of the key in question.
  • x and y specify the coordinates of the key.
  • col2 is optional. If present, additional keys in the row will be specified up to and including the key at ROW col2, each spaced a distance of +1.0 from the previous key. This feature allows evenly spaced runs of keys to be described in one line, greatly improving conciseness.
    For example,
    HOME 2 0.0 3.0 7
    
    is equivalent to:
    HOME 2 0.0 3.0
    HOME 3 1.0 3.0
    HOME 4 2.0 3.0
    HOME 5 3.0 3.0
    HOME 6 4.0 3.0
    HOME 7 5.0 3.0
    

Additional specifications may be given on their own lines. These options are:

  • default_key: Specifies a key that will be included by default in any layout using this board. The format for this is default_key: ROW col key_name. (More info on positions) If a layout specifies this key in a different position, or specifies a different key in this position, the layout's specification takes priority.

Constraintmaps

An example constraintmap (traditional-default) is shown below. The format is very similar to the fingermap specification.

0.025         0.025
          0.015
0.025 0.05 0.05     0.05 0.05 0.025

A maximum allowable usage frequency is specified for each key. Keys are separated using single spaces. If multiple spaces appear, the key(s) that would have been between the spaces will be skipped. Any key without a specified constraint will be unconstrained; that is, the maximum allowable frequency will be 1.0 (100%).

Double slashes // in the file can be used to delineate comments; anything from a // to the end of the line will be ignored by trialyzer.

Additional specifications may be given on their own lines, which will not be taken as part of the constraintmap. These options are:

  • first_pos: Specifies the position of the first key in the constraintmap. The format for this is first_pos: ROW col. Defaults to TOP 1 if not given.
Clone this wiki locally