diff --git a/check_layout.py b/check_layout.py index 9224f79..dc4644a 100644 --- a/check_layout.py +++ b/check_layout.py @@ -10,9 +10,8 @@ KNOWN_NOT_LAYOUT = set([ "clipboard_bottom_row" ]) KEY_ATTRIBUTES = set([ - "key0", - "key1", "key2", "key3", "key4", "key5", "key6", "key7", "key8", - "nw", "ne", "sw", "se", "w", "e", "n", "s" + "key0", "key1", "key2", "key3", "key4", "key5", "key6", "key7", "key8", + "c", "nw", "ne", "sw", "se", "w", "e", "n", "s" ]) def warn(msg): diff --git a/doc/Custom-layouts.md b/doc/Custom-layouts.md index b5fbb57..e9196f8 100644 --- a/doc/Custom-layouts.md +++ b/doc/Custom-layouts.md @@ -20,7 +20,7 @@ A layout XML file comprises tags that start with `<` and end with `>`. * An optional ``...`` pair contains instructions if you want to change the behavior of a modifier key such as Shift. * Stand-alone tags include ``, which defines a single key. -A tag can have properties, defined using an equals sign and a pair of ASCII double quotes. For example, `` defines the "a" key. The `key0` property of the `key` tag says which key you are defining, and the tag's location inside ``...`` specifies where it will go in the row. +A tag can have properties, defined using an equals sign and a pair of ASCII double quotes. For example, `` defines the "a" key. The `c` property of the `key` tag says which key you are defining, and the tag's location inside ``...`` specifies where it will go in the row. ### Example Here is a complete keyboard file with a single row containing an "a" key on the left and a "b" key on the right: @@ -28,8 +28,8 @@ Here is a complete keyboard file with a single row containing an "a" key on the - - + + @@ -59,7 +59,7 @@ A row's default height is 1.0 (one quarter of the keyboard height specified on t The `` tag defines a key on the keyboard. Its position in the sequence of keys inside ``...`` indicates its position in the row from left to right. What the key does is defined by optional properties. ### Taps -What the key does when tapped is defined by the optional `key0` property. For example, `` defines the "a" key. Unexpected Keyboard provides a legend in the middle of the key. +What the key does when tapped is defined by the optional `c` property. For example, `` defines the "a" key. Unexpected Keyboard provides a legend in the middle of the key. When the Shift modifier is tapped, the "a" key becomes the "A" key and the legend temporarily changes. The Fn modifier makes a different change. You can override this behavior with a modmap (see below). @@ -71,7 +71,7 @@ The following optional properties define the effects of swipes: nwnne - w e + wce swsse @@ -84,7 +84,7 @@ The following optional properties define the effects of swipes: key1key7key2 - key5 key6 + key5key0key6 key3key8key4 @@ -104,10 +104,10 @@ A key may have the following properties to control the row's layout: Normally, a key's width is 1.0 unit. Unexpected Keyboard occupies the full width of the screen, and the row defining the highest number of units (in widths plus shifts) is as wide as the screen. A row whose width is a smaller number of units has empty space on the right. ### Extra legend -* `indication`: An optional extra legend to show under the main label. For example, `` displays ABC at the bottom of the 2 key, as on a pinpad or some telephones. If the key also defines a downward swipe with `s` or `key8`, the legends overlap. +* `indication`: An optional extra legend to show under the main label. For example, `` displays ABC at the bottom of the 2 key, as on a pinpad or some telephones. If the key also defines a downward swipe with `s` or `key8`, the legends overlap. ### Possible key values -Built-in strings that assign a special function to a key are described in [this page](Possible-key-values.md). For example, `se="copy"` means a southeasterly swipe produces the Copy key. If a key value does not match any of the built-in strings, it outputs that text _verbatim_. For example, `key0="a"` simply outputs the letter a. +Built-in strings that assign a special function to a key are described in [this page](Possible-key-values.md). For example, `se="copy"` means a southeasterly swipe produces the Copy key. If a key value does not match any of the built-in strings, it outputs that text _verbatim_. For example, `c="a"` simply outputs the letter a. In a layout, a key value can also start with the `loc` prefix. These are place-holders; the tap or swipe does nothing unless enabled through the "Add keys to keyboard" option in the Settings menu, or implicitly enabled by the language the device is set to use. For example, `ne="loc accent_aigu"` says that a northeast swipe produces the acute accent combinatorial key—if enabled. diff --git a/srcs/juloo.keyboard2/KeyboardData.java b/srcs/juloo.keyboard2/KeyboardData.java index 3432fe1..aca8ba3 100644 --- a/srcs/juloo.keyboard2/KeyboardData.java +++ b/srcs/juloo.keyboard2/KeyboardData.java @@ -473,7 +473,7 @@ public final class KeyboardData { KeyValue[] ks = new KeyValue[9]; int keysflags = 0; - keysflags |= parse_key_attr(parser, parser.getAttributeValue(null, "key0"), ks, 0); + keysflags |= parse_key_attr(parser, get_key_attr(parser, "key0", "c"), ks, 0); /* Swipe gestures (key1-key8 diagram above), with compass-point synonyms. */ keysflags |= parse_key_attr(parser, get_key_attr(parser, "key1", "nw"), ks, 1); keysflags |= parse_key_attr(parser, get_key_attr(parser, "key2", "ne"), ks, 2); diff --git a/srcs/layouts/latn_qwerty_us.xml b/srcs/layouts/latn_qwerty_us.xml index 08c4961..a97525e 100644 --- a/srcs/layouts/latn_qwerty_us.xml +++ b/srcs/layouts/latn_qwerty_us.xml @@ -8,7 +8,7 @@ symbols to the corners of a key, they are arranged following the cardinal directions: nw n ne - w key0 e + w c e sw s se Symbols prefixed with 'loc ' are not visible on the keyboard. They are used to @@ -23,37 +23,37 @@ doc/Possible-key-values.md for the keys that have a special meaning. --> - - - - - - - - - - + + + + + + + + + + - - - - - - - - - + + + + + + + + + - - - - - - - - - + + + + + + + + +