keymaps: Use multiple key maps, each within the limit of what Xorg can accept.

Key maps are switched on key press whenever needed.
This commit is contained in:
Dorota Czaplejewicz
2020-09-28 17:29:59 +00:00
parent c686cf7e81
commit e6c136918c
13 changed files with 358 additions and 149 deletions

View File

@ -35,16 +35,18 @@ G_BEGIN_DECLS
/// Keyboard state holder
struct _LevelKeyboard {
struct squeek_layout *layout; // owned
struct xkb_keymap *keymap; // owned
int keymap_fd; // keymap formatted as XKB string
size_t keymap_len; // length of the data inside keymap_fd
// FIXME: This no longer needs to exist, keymap was folded into layout.
guint id; // as a key to layout choices
};
typedef struct _LevelKeyboard LevelKeyboard;
gchar * eek_keyboard_get_keymap
(LevelKeyboard *keyboard);
/// Keymap container for Rust interoperability.
struct KeyMap {
uint32_t fd; // keymap formatted as XKB string
size_t fd_len; // length of the data inside keymap_fd
};
gchar *eek_keyboard_get_keymap(LevelKeyboard *keyboard);
LevelKeyboard*
level_keyboard_new (struct squeek_layout *layout);