Made 'full' and 'simple' layouts less prone to mistyping and improved layout switching

- The full layout now squashes less keys in a row, to accomplish this
  the semicolon/colon, equal/plus and alt keys had to be sacrificed
  from the full layout (they're on the special/symbols layout still).
- The half-keys in the simple layout are removed, giving a bit more
  space.
- The default total keyboard height has been slightly enlarged (10px)
- The compose key moved down, it was too close to the 'a' (accidental
  presses). The tab key moved to the top-right.
- The spacing between the buttons is slightly larger (aesthetic only)
- The key for layer switching is now labelled more consistently with an icon, and indicates direction of switching with an arrow
- An extra "index" layout was added that can be activated by pressing
  Compose + the next/prev layout button. It has a key for each layout,
  even those not specified at start. This special layout does not appear
  in the normal layer cycling.
- The "Abc" key on secondary layers returns to the last alphabetical layout
- The compose layouts automatically hide when the user presses the space
  where there are no keys, no need to explicitly press the "Abc" key.
This commit is contained in:
Maarten van Gompel
2023-08-25 15:58:35 +02:00
parent b6ec34fe3a
commit 2e476c6548
5 changed files with 204 additions and 120 deletions

10
main.c
View File

@ -173,6 +173,9 @@ wl_touch_down(void *data, struct wl_touch *wl_touch, uint32_t serial,
next_key = kbd_get_key(&keyboard, touch_x, touch_y);
if (next_key) {
kbd_press_key(&keyboard, next_key, time);
} else if (keyboard.compose) {
keyboard.compose = 0;
kbd_switch_layout(&keyboard, keyboard.prevlayout, keyboard.last_abc_index);
}
}
@ -245,6 +248,9 @@ wl_pointer_button(void *data, struct wl_pointer *wl_pointer, uint32_t serial,
next_key = kbd_get_key(&keyboard, cur_x, cur_y);
if (next_key) {
kbd_press_key(&keyboard, next_key, time);
} else if (keyboard.compose) {
keyboard.compose = 0;
kbd_switch_layout(&keyboard, keyboard.prevlayout, keyboard.last_abc_index);
}
}
}
@ -301,8 +307,10 @@ display_handle_geometry(void *data, struct wl_output *wl_output, int x, int y,
}
keyboard.layout = &keyboard.layouts[layer];
keyboard.prevlayout = keyboard.layout;
keyboard.layer_index = 0;
keyboard.prevlayout = keyboard.layout;
keyboard.last_abc_layout = keyboard.layout;
keyboard.last_abc_index = 0;
if (layer_surface) {
zwlr_layer_surface_v1_set_size(layer_surface, 0, height);