[hackers] [PATCH 6/6] Made the old layouts compatible with the new svkbd, re-added the old english layout that was removed, and re-added the initial sxmo layout. Documentation updated accordingly. Final cleanup and fixes.

From: Maarten van Gompel <proycon_AT_anaproy.nl>
Date: Fri, 24 Jul 2020 21:50:00 +0200

---
 README          |  87 --------
 layout.arrows.h |  18 +-
 layout.de.h     |  18 +-
 layout.en.h     |  84 ++++++++
 layout.intl.h   | 522 ++++++++++++++++++++++++++++++++++++++++++++++++
 layout.ru.h     |  17 +-
 layout.sh.h     |  17 +-
 layout.sxmo.h   | 452 +++--------------------------------------
 svkbd.c         |  10 +-
 9 files changed, 703 insertions(+), 522 deletions(-)
 delete mode 100644 README
 create mode 100644 layout.en.h
 create mode 100644 layout.intl.h
diff --git a/README b/README
deleted file mode 100644
index fd0e4d9..0000000
--- a/README
+++ /dev/null
_AT_@ -1,87 +0,0 @@
-SVKBD: Simple Virtual Keyboard
-=================================
-
-This is a simple virtual keyboard, intended to be used in environments,
-where no keyboard is available.
-
-Installation
-------------
-
-	$ make
-	$ make install
-
-This will create by default `svkbd-intl`, which is svkbd using an international
-layout with multiple layers and overlays, and optimised for mobile devices.
-
-You can create svkbd for additional layouts by doing:
-
-	$ make LAYOUT=$layout
-
-This will take the file `layout.$layout.h` and create `svkbd-$layout`.
-`make install` will then pick up the new file and install it accordingly.
-
-Layouts
----------
-
-The following layouts are available:
-
-* **Mobile Layouts:**
-    * ``intl`` - A small international layout optimised for mobile devices. This layout consists of multiple layers which
-        can be switched on the fly, and overlays that appear on long-press of certain keys, adding input ability for
-        diacritics and other variants, as well as some emoji. The layers are:
-        * a basic qwerty layer
-        * a layer for numeric input, arrows, and punctuation
-        * a layer for function keys, media keys, and arrows
-        * a cyrillic layer (ЙЦУКЕН)
-        * a dialer/numeric layer
-    * ``sxmo`` - This is the original English layout for [sxmo](https://sr.ht/~mil/Sxmo) with only a qwerty layer and numeric/punctuation layer.
-* **Traditional layouts**:
-    * ``en`` - An english layout without layers (QWERTY)
-    * ``de`` - A german layout (QWERTZ)
-    * ``ru`` - A russian layout (ЙЦУКЕН)
-    * ``sh`` - A serbo-croatian layout using latin script (QWERTZ)
-
-Usage
------
-
-	$ svkbd-intl
-
-This will open svkbd at the bottom of the screen, showing the default
-international layout.
-
-	$ svkbd-intl -d
-
-This tells svkbd to announce itself being a dock window, which then
-is managed differently between different window managers. If using dwm
-and the dock patch, then this will make svkbd being managed by dwm and
-some space of the screen being reserved for it.
-
-	$ svkbd-intl -g 400x200+1+1
-
-This will start svkbd-intl with a size of 400x200 and at the upper left
-window corner.
-
-For layouts that consist of multiple layers, you can enable layers on program start through either the ``-l`` flag or
-through the ``SVKBD_LAYERS`` environment variable.  They both take a comma separated list of layer names (as defined in
-your ``layout.*.h``). Use the ``↺`` button in the bottom-left to cycle through all the layers.
-
-Some layouts come with overlays that will show when certain keys are hold pressed for a longer time. For
-example, a long press on the ``a`` key will enable an overview showing all kinds of diacritic combinations for ``a``.
-
-Overlay functionality interferes with the ability to hold a key and have it outputted repeatedly.  You can disable
-overlay functionality with the ``-O`` flag or by setting the environment variable ``SVKBD_ENABLEOVERLAYS=0``. There is
-also a key on the function layer of the keyboard itself to enable/disable this behaviour on the fly. Its label shows
-``≅`` when the overlay functionality is enabled and ``≇`` when not.
-
-Notes
----------
-
-This virtual keyboard does not actually modify the X keyboard layout, the ``intl``, ``sxmo`` and ``en`` layouts simply rely on a standard US QWERTY layout (setxkbmap us) being activated, the other layouts (``de``, ``ru``, ``sh``) require their respective XKB keymaps to be active.
-
-If you use another XKB layout you will get unpredictable output that does not match the labels on the virtual keycaps!
-
-Repository
-----------
-
-	git clone https://git.suckless.org/svkbd
-
diff --git a/layout.arrows.h b/layout.arrows.h
index f356518..29c2d0c 100644
--- a/layout.arrows.h
+++ b/layout.arrows.h
_AT_@ -1,11 +1,11 @@
-static Key keys[] = {
+#define KEYS 6
+static Key keys_arrows[] = {
 	{ 0, XK_Shift_L, 2 },
 	{ "←", XK_Left, 1 },
 	{ "↓", XK_Down, 1 },
 	{ "↑", XK_Up, 1 },
 	{ "→", XK_Right, 1},
 	{ "Alt", XK_Alt_L, 2 },
-	{ "[X]", XK_Cancel, 1 },
 };
 
 Buttonmod buttonmods[] = {
_AT_@ -13,3 +13,17 @@ Buttonmod buttonmods[] = {
 	{ XK_Alt_L, Button3 },
 };
 
+#define OVERLAYS 1
+static Key overlay[OVERLAYS] = {
+		{ 0, XK_Cancel },
+};
+
+#define LAYERS 1
+static char* layer_names[LAYERS] = {
+	"arrows",
+};
+
+static Key* available_layers[LAYERS] = {
+	keys_arrows,
+};
+
diff --git a/layout.de.h b/layout.de.h
index 2ef4b7d..d5778e5 100644
--- a/layout.de.h
+++ b/layout.de.h
_AT_@ -1,4 +1,5 @@
-static Key keys[] = {
+#define KEYS 66
+static Key keys_de[KEYS] = {
 	{ "^°′", XK_dead_circumflex, 1},
 	{ "1!¹", XK_1, 1 },
 	{ "2\"²", XK_2, 1 },
_AT_@ -65,7 +66,6 @@ static Key keys[] = {
 	{ "Alt Gr", XK_ISO_Level3_Shift, 2 },
 	{ "Menu", XK_Menu, 2 },
 	{ "Ctrl", XK_Control_R, 2 },
-	{ "[X]", XK_Cancel, 1},
 };
 
 Buttonmod buttonmods[] = {
_AT_@ -73,3 +73,17 @@ Buttonmod buttonmods[] = {
 	{ XK_Alt_L, Button3 },
 };
 
+#define OVERLAYS 1
+static Key overlay[OVERLAYS] = {
+	{ 0, XK_Cancel },
+};
+
+#define LAYERS 1
+static char* layer_names[LAYERS] = {
+	"de",
+};
+
+static Key* available_layers[LAYERS] = {
+	keys_de,
+};
+
diff --git a/layout.en.h b/layout.en.h
new file mode 100644
index 0000000..07cc602
--- /dev/null
+++ b/layout.en.h
_AT_@ -0,0 +1,84 @@
+#define KEYS 61
+static Key keys_en[] = {
+	{ "1!", XK_1, 1 },
+	{ "2_AT_", XK_2, 1 },
+	{ "3#", XK_3, 1 },
+	{ "4$", XK_4, 1 },
+	{ "5%", XK_5, 1 },
+	{ "6^", XK_6, 1 },
+	{ "7&", XK_7, 1 },
+	{ "8*", XK_8, 1 },
+	{ "9(", XK_9, 1 },
+	{ "0)", XK_0, 1 },
+	{ "-_", XK_minus, 1 },
+	{ "=+", XK_plus, 1 },
+	{ "<-", XK_BackSpace, 2 },
+	{ 0 }, /* New row */
+	{ "->|", XK_Tab, 1 },
+	{ 0, XK_q, 1 },
+	{ 0, XK_w, 1 },
+	{ 0, XK_e, 1 },
+	{ 0, XK_r, 1 },
+	{ 0, XK_t, 1 },
+	{ 0, XK_y, 1 },
+	{ 0, XK_u, 1 },
+	{ 0, XK_i, 1 },
+	{ 0, XK_o, 1 },
+	{ 0, XK_p, 1 },
+	{ "[", XK_bracketleft, 1 },
+	{ "]", XK_bracketright, 1 },
+	{ "Return", XK_Return, 3 },
+	{ 0 }, /* New row */
+	{ 0, XK_Caps_Lock, 2 },
+	{ 0, XK_a, 1 },
+	{ 0, XK_s, 1 },
+	{ 0, XK_d, 1 },
+	{ 0, XK_f, 1 },
+	{ 0, XK_g, 1 },
+	{ 0, XK_h, 1 },
+	{ 0, XK_j, 1 },
+	{ 0, XK_k, 1 },
+	{ 0, XK_l, 1 },
+	{ ":;", XK_semicolon, 1 },
+	{ "'\"", XK_exclam, 1 },
+	{ "\\|", XK_backslash, 1 },
+	{ 0 }, /* New row */
+	{ 0, XK_Shift_L, 3 },
+	{ 0, XK_z, 1 },
+	{ 0, XK_x, 1 },
+	{ 0, XK_c, 1 },
+	{ 0, XK_v, 1 },
+	{ 0, XK_b, 1 },
+	{ 0, XK_n, 1 },
+	{ 0, XK_m, 1 },
+	{ ",", XK_colon, 1 },
+	{ ".", XK_period, 1 },
+	{ "/?", XK_slash, 1 },
+	{ 0, XK_Shift_R, 2 },
+	{ 0 }, /* New row */
+	{ "Ctrl", XK_Control_L, 2 },
+	{ "Alt", XK_Alt_L, 2 },
+	{ "", XK_space, 5 },
+	{ "Alt", XK_Alt_R, 2 },
+	{ "Ctrl", XK_Control_R, 2 },
+};
+
+Buttonmod buttonmods[] = {
+	{ XK_Shift_L, Button2 },
+	{ XK_Alt_L, Button3 },
+};
+
+#define OVERLAYS 1
+static Key overlay[OVERLAYS] = {
+        { 0, XK_Cancel },
+};
+
+#define LAYERS 1
+static char* layer_names[LAYERS] = {
+    "en",
+};
+
+static Key* available_layers[LAYERS] = {
+    keys_en,
+};
+
diff --git a/layout.intl.h b/layout.intl.h
new file mode 100644
index 0000000..63bf1ca
--- /dev/null
+++ b/layout.intl.h
_AT_@ -0,0 +1,522 @@
+#define KEYS 43
+
+static Key keys_en[KEYS] = {
+        { "Esc", XK_Escape, 1 },
+        { 0, XK_q, 1 },
+        { 0, XK_w, 1 },
+        { 0, XK_e, 1 },
+        { 0, XK_r, 1 },
+        { 0, XK_t, 1 },
+        { 0, XK_y, 1 },
+        { 0, XK_u, 1 },
+        { 0, XK_i, 1 },
+        { 0, XK_o, 1 },
+        { 0, XK_p, 1 },
+
+        { 0 }, /* New row */
+
+        { "'\"", XK_apostrophe, 1 },
+        { 0, XK_a, 1 },
+        { 0, XK_s, 1 },
+        { 0, XK_d, 1 },
+        { 0, XK_f, 1 },
+        { 0, XK_g, 1 },
+        { 0, XK_h, 1 },
+        { 0, XK_j, 1 },
+        { 0, XK_k, 1 },
+        { 0, XK_l, 1 },
+        { "/?", XK_slash, 1 },
+
+        { 0 }, /* New row */
+
+        { "123", XK_Mode_switch, 1 },
+        { 0, XK_z, 1 },
+        { 0, XK_x, 1 },
+        { 0, XK_c, 1 },
+        { 0, XK_v, 1 },
+        { 0, XK_b, 1 },
+        { 0, XK_n, 1 },
+        { 0, XK_m, 1 },
+        { "Tab", XK_Tab, 1 },
+        { "⌫Bksp", XK_BackSpace, 2 },
+
+        { 0 }, /* New row */
+        { "↺", XK_Cancel, 1},
+        { "Shift", XK_Shift_L, 2 },
+        { "Ctrl", XK_Control_L, 1 },
+        { "Alt", XK_Alt_L, 1 },
+        { "", XK_space, 2 },
+        { "↓", XK_Down, 1 },
+        { "↑", XK_Up, 1 },
+        { "↲ Enter", XK_Return, 2 },
+};
+
+#define OVERLAYS 197
+static Key overlay[OVERLAYS] = {
+        { 0, XK_a }, //Overlay for a
+        //---
+        { "à", XK_agrave },
+        { "á", XK_aacute },
+        { "â", XK_acircumflex },
+        { "ä", XK_adiaeresis },
+        { "ą", XK_aogonek },
+        { "ã", XK_atilde },
+        { "ā", XK_amacron },
+        { "ă", XK_abreve },
+        { "å", XK_aring },
+        { "æ", XK_ae },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //--
+        { 0, XK_e }, //Overlay for e (first item after boundary defines the trigger)
+        //---
+        { "è", XK_egrave },
+        { "é", XK_eacute },
+        { "ê", XK_ecircumflex },
+        { "ë", XK_ediaeresis },
+        { "ę", XK_eogonek },
+        { "ē", XK_emacron },
+        { "ė", XK_eabovedot },
+        { 0, XK_Cancel },
+        //--
+        { 0, XK_y }, //New overlay
+        //---
+        { "ỳ", XK_ygrave },
+        { "ý", XK_yacute },
+        { "ŷ", XK_ycircumflex },
+        { "ÿ", XK_ydiaeresis },
+        { 0, XK_Cancel },
+        //--
+        { 0, XK_u }, //New overlay
+        //---
+        { "ù", XK_ugrave },
+        { "ú", XK_uacute },
+        { "û", XK_ucircumflex },
+        { "ü", XK_udiaeresis },
+        { "ų", XK_uogonek },
+        { "ū", XK_umacron },
+        { "ů", XK_uring},
+        { "ŭ", XK_ubreve},
+        { "ű", XK_udoubleacute },
+        { 0, XK_Cancel },
+        //--
+        { 0, XK_i }, //New overlay
+        //---
+        { "ì", XK_igrave },
+        { "í", XK_iacute },
+        { "î", XK_icircumflex },
+        { "ï", XK_idiaeresis },
+        { "į", XK_iogonek },
+        { "ī", XK_imacron },
+        { "ı", XK_idotless },
+        { 0, XK_Cancel },
+        //--
+        { 0, XK_o }, //New overlay
+        //---
+        { "ò", XK_ograve },
+        { "ó", XK_oacute },
+        { "ô", XK_ocircumflex },
+        { "ö", XK_odiaeresis },
+        { "ǫ", XK_ogonek },
+        { "õ", XK_otilde },
+        { "ō", XK_omacron },
+        { "ø", XK_oslash },
+        { "ő", XK_odoubleacute },
+        { "œ", XK_oe },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //--
+        { 0, XK_d }, //New overlay
+        //---
+        { "ď", XK_dcaron },
+        { "ð", XK_eth },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //--
+        { 0, XK_c }, //New overlay
+        //---
+        { "ç", XK_ccedilla },
+        { "ĉ", XK_ccircumflex },
+        { "č", XK_ccaron },
+        { "ć", XK_cacute },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //--
+        { 0, XK_s }, //New overlay
+        //---
+        { "ş", XK_scedilla },
+        { "ŝ", XK_scircumflex },
+        { "š", XK_scaron },
+        { "ś", XK_sacute },
+        { "ß", XK_ssharp },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //---
+        { 0, XK_z }, //New overlay
+        //---
+        { "ž", XK_zcaron },
+        { "ż", XK_zabovedot },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //--
+        { 0, XK_n }, //New overlay
+        //---
+        { "ñ", XK_ntilde },
+        { "ń", XK_nacute },
+        { "ň", XK_ncaron },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //
+        { 0, XK_t }, //New overlay
+        //---
+        { "ț", XK_tcedilla },
+        { "ť", XK_tcaron },
+        { "þ", XK_thorn },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //----
+        { 0, XK_g }, //New overlay
+        //---
+        { "ĝ", XK_gcircumflex },
+        { "ğ", XK_gbreve },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //
+        { 0, XK_h }, //New overlay
+        //---
+        { "ĥ", XK_hcircumflex },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //
+        { 0, XK_j }, //New overlay
+        //---
+        { "ĵ", XK_jcircumflex },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //--
+        { 0, XK_l }, //New overlay
+        //---
+        { "ł", XK_lstroke },
+        { "ľ", XK_lcaron },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //--
+        { 0, XK_r }, //New overlay
+        //---
+        { "ř", XK_rcaron },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //---
+        { 0, XK_Cyrillic_softsign }, //New overlay
+        //---
+        { "ъ", XK_Cyrillic_hardsign },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //---
+        { 0, XK_Cyrillic_ie }, //New overlay
+        //---
+        { "ё", XK_Cyrillic_io },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //---
+        { 0, XK_Cyrillic_e }, //New overlay
+        //---
+        { "Є", XK_Ukrainian_ie },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //---
+        { 0, XK_Cyrillic_i }, //New overlay
+        //---
+        { "і", XK_Ukrainian_i },
+        { "ї", XK_Ukrainian_yi },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //---
+        { 0, XK_Cyrillic_u }, //New overlay
+        //---
+        { "ў", XK_Byelorussian_shortu },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+		//---
+        { 0, XK_Cyrillic_shorti }, //New overlay
+        //---
+        { "ј", XK_Cyrillic_je },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+		//---
+        { 0, XK_Cyrillic_el }, //New overlay
+        //---
+        { "љ", XK_Cyrillic_lje },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+		//---
+        { 0, XK_Cyrillic_en }, //New overlay
+        //---
+        { "њ", XK_Cyrillic_nje },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+		//---
+        { 0, XK_Cyrillic_tse }, //New overlay
+        //---
+        { "џ", XK_Cyrillic_dzhe },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+		//---
+        { 0, XK_Cyrillic_che }, //New overlay
+        //---
+        { "ћ", XK_Serbian_tshe },
+        { "ђ", XK_Serbian_dje },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+		//---
+        { "🙂", 0x101f642 }, //emoji overlay
+        //---
+        { "😀", 0x101f600 },
+        { "😁", 0x101f601 },
+        { "😂", 0x101f602 },
+        { "😃", 0x101f603 },
+        { "😄", 0x101f604 },
+        { "😅", 0x101f605 },
+        { "😆", 0x101f606 },
+        { "😇", 0x101f607 },
+        { "😈", 0x101f608 },
+        { "😉", 0x101f609 },
+        { "😊", 0x101f60a },
+        { "😋", 0x101f60b },
+        { "😌", 0x101f60c },
+        { "😍", 0x101f60d },
+        { "😎", 0x101f60e },
+        { "😏", 0x101f60f },
+        { "😐", 0x101f610 },
+        { "😒", 0x101f612 },
+        { "😓", 0x101f613 },
+        { "😛", 0x101f61b },
+        { "😮", 0x101f62e },
+        { "😟", 0x101f61f },
+        { "😟", 0x101f620 },
+        { "😢", 0x101f622 },
+        { "😭", 0x101f62d },
+        { "😳", 0x101f633 },
+        { "😴", 0x101f634 },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+        //--
+		{ "/?", XK_slash }, //punctuation overlay
+		//--
+		{ "1!", XK_1, 1 },
+		{ "2_AT_", XK_2, 1 },
+		{ "3#", XK_3, 1 },
+		{ "4$", XK_4, 1 },
+		{ "5%", XK_5, 1 },
+		{ "6^", XK_6, 1 },
+		{ "7&", XK_7, 1 },
+		{ "8*", XK_8, 1 },
+		{ "9(", XK_9, 1 },
+		{ "0)", XK_0, 1 },
+		{ "'\"", XK_apostrophe, 1 },
+		{ "`~", XK_grave, 1 },
+		{ "-_", XK_minus, 1 },
+		{ "=+", XK_plus, 1 },
+		{ "[{", XK_bracketleft, 1 },
+		{ "]}", XK_bracketright, 1 },
+		{ ",<", XK_comma, 1 },
+		{ ".>", XK_period, 1 },
+		{ "/?", XK_slash, 1 },
+		{ "\\|", XK_backslash, 1 },
+		{ "¡", XK_exclamdown, 1 },
+		{ "?", XK_questiondown, 1 },
+		{ "°", XK_degree, 1 },
+		{ "£", XK_sterling, 1 },
+		{ "€", XK_EuroSign, 1 },
+		{ "¥", XK_yen, 1 },
+		{ ";:", XK_colon, 1 },
+        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
+};
+
+
+static Key keys_symbols[KEYS] = {
+  { "Esc", XK_Escape, 1 },
+  { "1!", XK_1, 1 },
+  { "2_AT_", XK_2, 1 },
+  { "3#", XK_3, 1 },
+  { "4$", XK_4, 1 },
+  { "5%", XK_5, 1 },
+  { "6^", XK_6, 1 },
+  { "7&", XK_7, 1 },
+  { "8*", XK_8, 1 },
+  { "9(", XK_9, 1 },
+  { "0)", XK_0, 1 },
+
+  { 0 }, /* New row */
+
+  { "'\"", XK_apostrophe, 1 },
+  { "`~", XK_grave, 1 },
+  { "-_", XK_minus, 1 },
+  { "=+", XK_plus, 1 },
+  { "[{", XK_bracketleft, 1 },
+  { "]}", XK_bracketright, 1 },
+  { ",<", XK_comma, 1 },
+  { ".>", XK_period, 1 },
+  { "/?", XK_slash, 1 },
+  { "\\|", XK_backslash, 1 },
+  { ";:", XK_colon, 1 },
+
+  { 0 }, /* New row */
+
+  { "abc", XK_Mode_switch, 1 },
+  { "☺", 0x101f642, 1 },
+  { "⇤", XK_Home, 1 },
+  { "←", XK_Left, 1 },
+  { "→", XK_Right, 1 },
+  { "⇥", XK_End, 1 },
+  { "⇊", XK_Next, 1 },
+  { "⇈", XK_Prior, 1 },
+  { "Tab", XK_Tab, 1 },
+  { "⌫Bksp", XK_BackSpace, 2 },
+
+  { 0 }, /* New row */
+  { "↺", XK_Cancel, 1},
+  { "Shift", XK_Shift_L, 2 },
+  { "Ctrl", XK_Control_L, 1 },
+  { "Alt", XK_Alt_L, 1 },
+  { "", XK_space, 2 },
+  { "↓", XK_Down, 1 },
+  { "↑", XK_Up, 1 },
+  { "↲ Enter", XK_Return, 2 },
+};
+
+static Key keys_functions[KEYS] = {
+  { "Esc", XK_Escape, 1 },
+  { "F1", XK_F1, 1 },
+  { "F2", XK_F2, 1 },
+  { "F3", XK_F3, 1 },
+  { "F4", XK_F4, 1 },
+  { "F5", XK_F5, 1 },
+  { "F6", XK_F6, 1 },
+  { "F7", XK_F7, 1 },
+  { "F8", XK_F8, 1 },
+  { "F9", XK_F9, 1 },
+  { "F10", XK_F10, 1 },
+
+  { 0 }, /* New row */
+
+  { "≅", XK_KP_Insert, 1 },
+  { "▶", XF86XK_AudioPlay, 1 },
+  { "●", XF86XK_AudioRecord, 1 },
+  { "■", XF86XK_AudioStop, 1 },
+  { "◂◂", XF86XK_AudioPrev, 1 },
+  { "▸▸", XF86XK_AudioNext, 1 },
+  { "♫M", XF86XK_AudioMute, 1 },
+  { "♫-", XF86XK_AudioLowerVolume, 1 },
+  { "♫+", XF86XK_AudioRaiseVolume, 1 },
+  { "☀-", XF86XK_MonBrightnessDown, 1 },
+  { "☀+", XF86XK_MonBrightnessUp, 1 },
+
+  { 0 }, /* New row */
+
+  { "abc", XK_Mode_switch, 1 },
+  { "Del", XK_Delete, 1 },
+  { "⇤", XK_Home, 1 },
+  { "←", XK_Left, 1 },
+  { "→", XK_Right, 1 },
+  { "⇥", XK_End, 1 },
+  { "⇊", XK_Next, 1 },
+  { "⇈", XK_Prior, 1 },
+  { "Tab", XK_Tab, 1 },
+  { "⌫Bksp", XK_BackSpace, 2 },
+
+  { 0 }, /* New row */
+  { "↺", XK_Cancel, 1},
+  { "Shift", XK_Shift_L, 2 },
+  { "Ctrl", XK_Control_L, 1 },
+  { "Alt", XK_Alt_L, 1 },
+  { "", XK_space, 2 },
+  { "↓", XK_Down, 1 },
+  { "↑", XK_Up, 1 },
+  { "↲ Enter", XK_Return, 2 },
+};
+
+
+static Key keys_ru[KEYS] = {
+        { "и", XK_Cyrillic_shorti, 1 },
+        { "ц", XK_Cyrillic_tse, 1 },
+        { "у", XK_Cyrillic_u, 1 },
+        { "к", XK_Cyrillic_ka, 1 },
+        { "е", XK_Cyrillic_ie, 1 },
+        { "н", XK_Cyrillic_en, 1 },
+        { "г", XK_Cyrillic_ghe, 1 },
+        { "ш", XK_Cyrillic_sha, 1 },
+        { "щ", XK_Cyrillic_shcha, 1 },
+        { "з", XK_Cyrillic_ze, 1 },
+        { "х", XK_Cyrillic_ha, 1 },
+
+        { 0 }, /* New row */
+
+        { "ф", XK_Cyrillic_ef, 1 },
+        { "ы", XK_Cyrillic_yeru, 1 },
+        { "в", XK_Cyrillic_ve, 1 },
+        { "а", XK_Cyrillic_a, 1 },
+        { "п", XK_Cyrillic_pe, 1 },
+        { "о", XK_Cyrillic_o, 1 },
+        { "л", XK_Cyrillic_el, 1 },
+        { "д", XK_Cyrillic_de, 1 },
+        { "ж", XK_Cyrillic_zhe, 1 },
+        { "э", XK_Cyrillic_e, 1 },
+        { "ю", XK_Cyrillic_yu, 1 },
+
+        { 0 }, /* New row */
+
+        { "123", XK_Mode_switch, 1 },
+        { "я", XK_Cyrillic_ya, 1 },
+        { "ч", XK_Cyrillic_che, 1 },
+        { "с", XK_Cyrillic_es, 1 },
+        { "м", XK_Cyrillic_em, 1 },
+        { "и", XK_Cyrillic_i, 1 },
+        { "т", XK_Cyrillic_te, 1 },
+        { "ь", XK_Cyrillic_softsign, 1 },
+        { "б", XK_Cyrillic_be, 1 },
+        { "⌫Bksp", XK_BackSpace, 2 },
+
+        { 0 }, /* New row */
+        { "↺", XK_Cancel, 1},
+        { "Shift", XK_Shift_L, 2 },
+        { "Ctrl", XK_Control_L, 1 },
+        { "Alt", XK_Alt_L, 1 },
+        { "", XK_space, 2 },
+        { "↓", XK_Down, 1 },
+        { "↑", XK_Up, 1 },
+        { "↲ Enter", XK_Return, 2 },
+};
+
+static Key keys_dialer[KEYS] = {
+        { "Esc", XK_Escape, 1 },
+        { "1!", XK_1, 1 },
+        { "2_AT_", XK_2, 1 },
+        { "3#", XK_3, 1 },
+        { "⌫Bksp", XK_BackSpace, 2 },
+        { 0 }, /* New row */
+
+        { "Shift", XK_Shift_L, 1 },
+        { "4$", XK_4, 1 },
+        { "5%", XK_5, 1 },
+        { "6^", XK_6, 1 },
+        { "-_", XK_minus, 1 },
+        { ",<", XK_comma, 1 },
+        { 0 }, /* New row */
+
+        { "abc", XK_Mode_switch, 1 },
+        { "7&", XK_7, 1 },
+        { "8*", XK_8, 1 },
+        { "9(", XK_9, 1 },
+        { "=+", XK_equal, 1 },
+        { "/?", XK_slash, 1 },
+        { 0 }, /* New row */
+
+        { "↺", XK_Cancel, 1},
+        { "", XK_space, 1 },
+        { "0)", XK_0, 1 },
+        { ".>", XK_period, 1 },
+        { "↲ Enter", XK_Return, 2},
+        { 0 }, /* New row */
+        { 0 }, /* Last item (double 0) */
+};
+
+#define LAYERS 5
+static char* layer_names[LAYERS] = {
+    "en",
+    "symbols",
+    "functions",
+    "dialer",
+    "ru",
+};
+
+static Key* available_layers[LAYERS] = {
+    keys_en,
+    keys_symbols,
+    keys_functions,
+    keys_dialer,
+    keys_ru
+};
+
+
+Buttonmod buttonmods[] = {
+        { XK_Shift_L, Button2 },
+        { XK_Alt_L, Button3 },
+};
+
diff --git a/layout.ru.h b/layout.ru.h
index ec7b84c..3a40439 100644
--- a/layout.ru.h
+++ b/layout.ru.h
_AT_@ -1,4 +1,5 @@
-static Key keys[] = {
+#define KEYS 63
+static Key keys_ru[] = {
 	{ "ёЁ", XK_Cyrillic_io, 1 },
 	{ "1!", XK_1, 1 },
 	{ "2\"", XK_2, 1 },
_AT_@ -62,7 +63,6 @@ static Key keys[] = {
 	{ "", XK_space, 5 },
 	{ "Alt", XK_Alt_R, 2 },
 	{ "Ctrl", XK_Control_R, 2 },
-	{ "[X]", XK_Cancel, 1},
 };
 
 Buttonmod buttonmods[] = {
_AT_@ -70,3 +70,16 @@ Buttonmod buttonmods[] = {
 	{ XK_Alt_L, Button3 },
 };
 
+#define OVERLAYS 1
+static Key overlay[OVERLAYS] = {
+	{ 0, XK_Cancel },
+};
+
+#define LAYERS 1
+static char* layer_names[LAYERS] = {
+	"ru",
+};
+
+static Key* available_layers[LAYERS] = {
+	keys_ru,
+};
diff --git a/layout.sh.h b/layout.sh.h
index 42d56f4..b36b70a 100644
--- a/layout.sh.h
+++ b/layout.sh.h
_AT_@ -1,4 +1,5 @@
-static Key keys[] = {
+#define KEYS 66
+static Key keys_sh[] = {
 	{ "`~", XK_quoteleft, 1},
 	{ "1!~", XK_1, 1 },
 	{ "2\"ˇ", XK_2, 1 },
_AT_@ -65,7 +66,6 @@ static Key keys[] = {
 	{ "Alt Gr", XK_ISO_Level3_Shift, 2 },
 	{ "Menu", XK_Menu, 2 },
 	{ "Ctrl", XK_Control_R, 2 },
-	{ "[X]", XK_Cancel, 1},
 };
 
 Buttonmod buttonmods[] = {
_AT_@ -73,3 +73,16 @@ Buttonmod buttonmods[] = {
 	{ XK_Alt_L, Button3 },
 };
 
+#define OVERLAYS 1
+static Key overlay[OVERLAYS] = {
+	{ 0, XK_Cancel },
+};
+
+#define LAYERS 1
+static char* layer_names[LAYERS] = {
+	"sh",
+};
+
+static Key* available_layers[LAYERS] = {
+	keys_sh,
+};
diff --git a/layout.sxmo.h b/layout.sxmo.h
index 6aafdb3..a261862 100644
--- a/layout.sxmo.h
+++ b/layout.sxmo.h
_AT_@ -1,8 +1,5 @@
-#define KEYS 43
-static Key keys[KEYS] = { NULL };
-
+#define KEYS 40
 static Key keys_en[KEYS] = {
-        { "Esc", XK_Escape, 1 },
         { 0, XK_q, 1 },
         { 0, XK_w, 1 },
         { 0, XK_e, 1 },
_AT_@ -16,7 +13,6 @@ static Key keys_en[KEYS] = {
 
         { 0 }, /* New row */
 
-        { "'\"", XK_apostrophe, 1 },
         { 0, XK_a, 1 },
         { 0, XK_s, 1 },
         { 0, XK_d, 1 },
_AT_@ -26,11 +22,11 @@ static Key keys_en[KEYS] = {
         { 0, XK_j, 1 },
         { 0, XK_k, 1 },
         { 0, XK_l, 1 },
-        { "/?", XK_slash, 1 },
+        { ";:", XK_colon, 1 },
+        /*{ "'", XK_apostrophe, 2 },*/
 
         { 0 }, /* New row */
 
-        { "123", XK_Mode_switch, 1 },
         { 0, XK_z, 1 },
         { 0, XK_x, 1 },
         { 0, XK_c, 1 },
_AT_@ -38,281 +34,25 @@ static Key keys_en[KEYS] = {
         { 0, XK_b, 1 },
         { 0, XK_n, 1 },
         { 0, XK_m, 1 },
+        /*{ "/?", XK_slash, 1 },*/
         { "Tab", XK_Tab, 1 },
-        { "⌫Bksp", XK_BackSpace, 2 },
+        { "⇍ Bksp", XK_BackSpace, 2 },
 
         { 0 }, /* New row */
         { "↺", XK_Cancel, 1},
-        { "Shift", XK_Shift_L, 2 },
-        { "Ctrl", XK_Control_L, 1 },
-        { "Alt", XK_Alt_L, 1 },
-        { "", XK_space, 2 },
+        { "Shft", XK_Shift_L, 1 },
+        /*{ "L", XK_Left, 1 },*/
         { "↓", XK_Down, 1 },
         { "↑", XK_Up, 1 },
+        /*{ "R", XK_Right, 1 },*/
+        { "", XK_space, 2 },
+        { "Esc", XK_Escape, 1 },
+        { "Ctrl", XK_Control_L, 1 },
+        /*{ "Alt", XK_Alt_L, 1 },*/
         { "↲ Enter", XK_Return, 2 },
 };
 
-#define OVERLAYS 197
-static Key overlay[OVERLAYS] = {
-        { 0, XK_a }, //Overlay for a
-        //---
-        { "à", XK_agrave },
-        { "á", XK_aacute },
-        { "â", XK_acircumflex },
-        { "ä", XK_adiaeresis },
-        { "ą", XK_aogonek },
-        { "ã", XK_atilde },
-        { "ā", XK_amacron },
-        { "ă", XK_abreve },
-        { "å", XK_aring },
-        { "æ", XK_ae },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //--
-        { 0, XK_e }, //Overlay for e (first item after boundary defines the trigger)
-        //---
-        { "è", XK_egrave },
-        { "é", XK_eacute },
-        { "ê", XK_ecircumflex },
-        { "ë", XK_ediaeresis },
-        { "ę", XK_eogonek },
-        { "ē", XK_emacron },
-        { "ė", XK_eabovedot },
-        { 0, XK_Cancel },
-        //--
-        { 0, XK_y }, //New overlay
-        //---
-        { "ỳ", XK_ygrave },
-        { "ý", XK_yacute },
-        { "ŷ", XK_ycircumflex },
-        { "ÿ", XK_ydiaeresis },
-        { 0, XK_Cancel },
-        //--
-        { 0, XK_u }, //New overlay
-        //---
-        { "ù", XK_ugrave },
-        { "ú", XK_uacute },
-        { "û", XK_ucircumflex },
-        { "ü", XK_udiaeresis },
-        { "ų", XK_uogonek },
-        { "ū", XK_umacron },
-        { "ů", XK_uring},
-        { "ŭ", XK_ubreve},
-        { "ű", XK_udoubleacute },
-        { 0, XK_Cancel },
-        //--
-        { 0, XK_i }, //New overlay
-        //---
-        { "ì", XK_igrave },
-        { "í", XK_iacute },
-        { "î", XK_icircumflex },
-        { "ï", XK_idiaeresis },
-        { "į", XK_iogonek },
-        { "ī", XK_imacron },
-        { "ı", XK_idotless },
-        { 0, XK_Cancel },
-        //--
-        { 0, XK_o }, //New overlay
-        //---
-        { "ò", XK_ograve },
-        { "ó", XK_oacute },
-        { "ô", XK_ocircumflex },
-        { "ö", XK_odiaeresis },
-        { "ǫ", XK_ogonek },
-        { "õ", XK_otilde },
-        { "ō", XK_omacron },
-        { "ø", XK_oslash },
-        { "ő", XK_odoubleacute },
-        { "œ", XK_oe },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //--
-        { 0, XK_d }, //New overlay
-        //---
-        { "ď", XK_dcaron },
-        { "ð", XK_eth },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //--
-        { 0, XK_c }, //New overlay
-        //---
-        { "ç", XK_ccedilla },
-        { "ĉ", XK_ccircumflex },
-        { "č", XK_ccaron },
-        { "ć", XK_cacute },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //--
-        { 0, XK_s }, //New overlay
-        //---
-        { "ş", XK_scedilla },
-        { "ŝ", XK_scircumflex },
-        { "š", XK_scaron },
-        { "ś", XK_sacute },
-        { "ß", XK_ssharp },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //---
-        { 0, XK_z }, //New overlay
-        //---
-        { "ž", XK_zcaron },
-        { "ż", XK_zabovedot },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //--
-        { 0, XK_n }, //New overlay
-        //---
-        { "ñ", XK_ntilde },
-        { "ń", XK_nacute },
-        { "ň", XK_ncaron },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //
-        { 0, XK_t }, //New overlay
-        //---
-        { "ț", XK_tcedilla },
-        { "ť", XK_tcaron },
-        { "þ", XK_thorn },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //----
-        { 0, XK_g }, //New overlay
-        //---
-        { "ĝ", XK_gcircumflex },
-        { "ğ", XK_gbreve },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //
-        { 0, XK_h }, //New overlay
-        //---
-        { "ĥ", XK_hcircumflex },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //
-        { 0, XK_j }, //New overlay
-        //---
-        { "ĵ", XK_jcircumflex },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //--
-        { 0, XK_l }, //New overlay
-        //---
-        { "ł", XK_lstroke },
-        { "ľ", XK_lcaron },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //--
-        { 0, XK_r }, //New overlay
-        //---
-        { "ř", XK_rcaron },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //---
-        { 0, XK_Cyrillic_softsign }, //New overlay
-        //---
-        { "ъ", XK_Cyrillic_hardsign },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //---
-        { 0, XK_Cyrillic_ie }, //New overlay
-        //---
-        { "ё", XK_Cyrillic_io },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //---
-        { 0, XK_Cyrillic_e }, //New overlay
-        //---
-        { "Є", XK_Ukrainian_ie },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //---
-        { 0, XK_Cyrillic_i }, //New overlay
-        //---
-        { "і", XK_Ukrainian_i },
-        { "ї", XK_Ukrainian_yi },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //---
-        { 0, XK_Cyrillic_u }, //New overlay
-        //---
-        { "ў", XK_Byelorussian_shortu },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-		//---
-        { 0, XK_Cyrillic_shorti }, //New overlay
-        //---
-        { "ј", XK_Cyrillic_je },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-		//---
-        { 0, XK_Cyrillic_el }, //New overlay
-        //---
-        { "љ", XK_Cyrillic_lje },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-		//---
-        { 0, XK_Cyrillic_en }, //New overlay
-        //---
-        { "њ", XK_Cyrillic_nje },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-		//---
-        { 0, XK_Cyrillic_tse }, //New overlay
-        //---
-        { "џ", XK_Cyrillic_dzhe },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-		//---
-        { 0, XK_Cyrillic_che }, //New overlay
-        //---
-        { "ћ", XK_Serbian_tshe },
-        { "ђ", XK_Serbian_dje },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-		//---
-        { "🙂", 0x101f642 }, //emoji overlay
-        //---
-        { "😀", 0x101f600 },
-        { "😁", 0x101f601 },
-        { "😂", 0x101f602 },
-        { "😃", 0x101f603 },
-        { "😄", 0x101f604 },
-        { "😅", 0x101f605 },
-        { "😆", 0x101f606 },
-        { "😇", 0x101f607 },
-        { "😈", 0x101f608 },
-        { "😉", 0x101f609 },
-        { "😊", 0x101f60a },
-        { "😋", 0x101f60b },
-        { "😌", 0x101f60c },
-        { "😍", 0x101f60d },
-        { "😎", 0x101f60e },
-        { "😏", 0x101f60f },
-        { "😐", 0x101f610 },
-        { "😒", 0x101f612 },
-        { "😓", 0x101f613 },
-        { "😛", 0x101f61b },
-        { "😮", 0x101f62e },
-        { "😟", 0x101f61f },
-        { "😟", 0x101f620 },
-        { "😢", 0x101f622 },
-        { "😭", 0x101f62d },
-        { "😳", 0x101f633 },
-        { "😴", 0x101f634 },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-        //--
-		{ "/?", XK_slash }, //punctuation overlay
-		//--
-		{ "1!", XK_1, 1 },
-		{ "2_AT_", XK_2, 1 },
-		{ "3#", XK_3, 1 },
-		{ "4$", XK_4, 1 },
-		{ "5%", XK_5, 1 },
-		{ "6^", XK_6, 1 },
-		{ "7&", XK_7, 1 },
-		{ "8*", XK_8, 1 },
-		{ "9(", XK_9, 1 },
-		{ "0)", XK_0, 1 },
-		{ "'\"", XK_apostrophe, 1 },
-		{ "`~", XK_grave, 1 },
-		{ "-_", XK_minus, 1 },
-		{ "=+", XK_plus, 1 },
-		{ "[{", XK_bracketleft, 1 },
-		{ "]}", XK_bracketright, 1 },
-		{ ",<", XK_comma, 1 },
-		{ ".>", XK_period, 1 },
-		{ "/?", XK_slash, 1 },
-		{ "\\|", XK_backslash, 1 },
-		{ "¡", XK_exclamdown, 1 },
-		{ "?", XK_questiondown, 1 },
-		{ "°", XK_degree, 1 },
-		{ "£", XK_sterling, 1 },
-		{ "€", XK_EuroSign, 1 },
-		{ "¥", XK_yen, 1 },
-		{ ";:", XK_colon, 1 },
-        { 0, XK_Cancel }, /* XK_Cancel signifies  overlay boundary */
-};
-
-
-static Key keys_symbols[KEYS] = {
-  { "Esc", XK_Escape, 1 },
+static Key keys_symbols[40] = {
   { "1!", XK_1, 1 },
   { "2_AT_", XK_2, 1 },
   { "3#", XK_3, 1 },
_AT_@ -336,12 +76,10 @@ static Key keys_symbols[KEYS] = {
   { ".>", XK_period, 1 },
   { "/?", XK_slash, 1 },
   { "\\|", XK_backslash, 1 },
-  { ";:", XK_colon, 1 },
 
   { 0 }, /* New row */
 
-  { "abc", XK_Mode_switch, 1 },
-  { "☺", 0x101f642, 1 },
+  { "", XK_Shift_L|XK_bar, 1 },
   { "⇤", XK_Home, 1 },
   { "←", XK_Left, 1 },
   { "→", XK_Right, 1 },
_AT_@ -349,175 +87,39 @@ static Key keys_symbols[KEYS] = {
   { "⇊", XK_Next, 1 },
   { "⇈", XK_Prior, 1 },
   { "Tab", XK_Tab, 1 },
-  { "⌫Bksp", XK_BackSpace, 2 },
+  { "⇍ Bksp", XK_BackSpace, 2 },
 
   { 0 }, /* New row */
   { "↺", XK_Cancel, 1},
-  { "Shift", XK_Shift_L, 2 },
-  { "Ctrl", XK_Control_L, 1 },
-  { "Alt", XK_Alt_L, 1 },
-  { "", XK_space, 2 },
+  { "Shft", XK_Shift_L, 1 },
+  /*{ "L", XK_Left, 1 },*/
   { "↓", XK_Down, 1 },
   { "↑", XK_Up, 1 },
-  { "↲ Enter", XK_Return, 2 },
-};
-
-static Key keys_functions[KEYS] = {
+  /*{ "R", XK_Right, 1 },*/
+  { "", XK_space, 2 },
   { "Esc", XK_Escape, 1 },
-  { "F1", XK_F1, 1 },
-  { "F2", XK_F2, 1 },
-  { "F3", XK_F3, 1 },
-  { "F4", XK_F4, 1 },
-  { "F5", XK_F5, 1 },
-  { "F6", XK_F6, 1 },
-  { "F7", XK_F7, 1 },
-  { "F8", XK_F8, 1 },
-  { "F9", XK_F9, 1 },
-  { "F10", XK_F10, 1 },
-
-  { 0 }, /* New row */
-
-  { "≅", XK_KP_Insert, 1 },
-  { "▶", XF86XK_AudioPlay, 1 },
-  { "●", XF86XK_AudioRecord, 1 },
-  { "■", XF86XK_AudioStop, 1 },
-  { "◂◂", XF86XK_AudioPrev, 1 },
-  { "▸▸", XF86XK_AudioNext, 1 },
-  { "♫M", XF86XK_AudioMute, 1 },
-  { "♫-", XF86XK_AudioLowerVolume, 1 },
-  { "♫+", XF86XK_AudioRaiseVolume, 1 },
-  { "☀-", XF86XK_MonBrightnessDown, 1 },
-  { "☀+", XF86XK_MonBrightnessUp, 1 },
-
-  { 0 }, /* New row */
-
-  { "abc", XK_Mode_switch, 1 },
-  { "Del", XK_Delete, 1 },
-  { "⇤", XK_Home, 1 },
-  { "←", XK_Left, 1 },
-  { "→", XK_Right, 1 },
-  { "⇥", XK_End, 1 },
-  { "⇊", XK_Next, 1 },
-  { "⇈", XK_Prior, 1 },
-  { "Tab", XK_Tab, 1 },
-  { "⌫Bksp", XK_BackSpace, 2 },
-
-  { 0 }, /* New row */
-  { "↺", XK_Cancel, 1},
-  { "Shift", XK_Shift_L, 2 },
   { "Ctrl", XK_Control_L, 1 },
-  { "Alt", XK_Alt_L, 1 },
-  { "", XK_space, 2 },
-  { "↓", XK_Down, 1 },
-  { "↑", XK_Up, 1 },
+  /*{ "Alt", XK_Alt_L, 1 },*/
   { "↲ Enter", XK_Return, 2 },
 };
 
-
-static Key keys_ru[KEYS] = {
-        { "и", XK_Cyrillic_shorti, 1 },
-        { "ц", XK_Cyrillic_tse, 1 },
-        { "у", XK_Cyrillic_u, 1 },
-        { "к", XK_Cyrillic_ka, 1 },
-        { "е", XK_Cyrillic_ie, 1 },
-        { "н", XK_Cyrillic_en, 1 },
-        { "г", XK_Cyrillic_ghe, 1 },
-        { "ш", XK_Cyrillic_sha, 1 },
-        { "щ", XK_Cyrillic_shcha, 1 },
-        { "з", XK_Cyrillic_ze, 1 },
-        { "х", XK_Cyrillic_ha, 1 },
-
-        { 0 }, /* New row */
-
-        { "ф", XK_Cyrillic_ef, 1 },
-        { "ы", XK_Cyrillic_yeru, 1 },
-        { "в", XK_Cyrillic_ve, 1 },
-        { "а", XK_Cyrillic_a, 1 },
-        { "п", XK_Cyrillic_pe, 1 },
-        { "о", XK_Cyrillic_o, 1 },
-        { "л", XK_Cyrillic_el, 1 },
-        { "д", XK_Cyrillic_de, 1 },
-        { "ж", XK_Cyrillic_zhe, 1 },
-        { "э", XK_Cyrillic_e, 1 },
-        { "ю", XK_Cyrillic_yu, 1 },
-
-        { 0 }, /* New row */
-
-        { "123", XK_Mode_switch, 1 },
-        { "я", XK_Cyrillic_ya, 1 },
-        { "ч", XK_Cyrillic_che, 1 },
-        { "с", XK_Cyrillic_es, 1 },
-        { "м", XK_Cyrillic_em, 1 },
-        { "и", XK_Cyrillic_i, 1 },
-        { "т", XK_Cyrillic_te, 1 },
-        { "ь", XK_Cyrillic_softsign, 1 },
-        { "б", XK_Cyrillic_be, 1 },
-        { "⌫Bksp", XK_BackSpace, 2 },
-
-        { 0 }, /* New row */
-        { "↺", XK_Cancel, 1},
-        { "Shift", XK_Shift_L, 2 },
-        { "Ctrl", XK_Control_L, 1 },
-        { "Alt", XK_Alt_L, 1 },
-        { "", XK_space, 2 },
-        { "↓", XK_Down, 1 },
-        { "↑", XK_Up, 1 },
-        { "↲ Enter", XK_Return, 2 },
+Buttonmod buttonmods[] = {
+        { XK_Shift_L, Button2 },
+        { XK_Alt_L, Button3 },
 };
 
-static Key keys_dialer[KEYS] = {
-        { "Esc", XK_Escape, 1 },
-        { "1!", XK_1, 1 },
-        { "2_AT_", XK_2, 1 },
-        { "3#", XK_3, 1 },
-        { "⌫Bksp", XK_BackSpace, 2 },
-        { 0 }, /* New row */
-
-        { "Shift", XK_Shift_L, 1 },
-        { "4$", XK_4, 1 },
-        { "5%", XK_5, 1 },
-        { "6^", XK_6, 1 },
-        { "-_", XK_minus, 1 },
-        { ",<", XK_comma, 1 },
-        { 0 }, /* New row */
-
-        { "abc", XK_Mode_switch, 1 },
-        { "7&", XK_7, 1 },
-        { "8*", XK_8, 1 },
-        { "9(", XK_9, 1 },
-        { "=+", XK_equal, 1 },
-        { "/?", XK_slash, 1 },
-        { 0 }, /* New row */
-
-        { "↺", XK_Cancel, 1},
-        { "", XK_space, 1 },
-        { "0)", XK_0, 1 },
-        { ".>", XK_period, 1 },
-        { "↲ Enter", XK_Return, 2},
-        { 0 }, /* New row */
-        { 0 }, /* Last item (double 0) */
+#define OVERLAYS 1
+static Key overlay[OVERLAYS] = {
+        { 0, XK_Cancel },
 };
 
-#define LAYERS 5
+#define LAYERS 2
 static char* layer_names[LAYERS] = {
     "en",
     "symbols",
-    "functions",
-    "dialer",
-    "ru",
 };
 
 static Key* available_layers[LAYERS] = {
     keys_en,
     keys_symbols,
-    keys_functions,
-    keys_dialer,
-    keys_ru
 };
-
-
-Buttonmod buttonmods[] = {
-        { XK_Shift_L, Button2 },
-        { XK_Alt_L, Button3 },
-};
-
diff --git a/svkbd.c b/svkbd.c
index ae0267e..2b171f7 100644
--- a/svkbd.c
+++ b/svkbd.c
_AT_@ -125,6 +125,7 @@ Bool sigtermd = False;
 #endif
 #include LAYOUT
 
+static Key keys[KEYS] = { NULL };
 static Key* layers[LAYERS];
 
 void
_AT_@ -879,9 +880,14 @@ main(int argc, char *argv[]) {
 
 	signal(SIGTERM, sigterm);
 
+
 	//parse environment variables
-	const char* enableoverlays_env = getenv("SVKBD_ENABLEOVERLAYS");
-	if (enableoverlays_env != NULL) enableoverlays = atoi(enableoverlays_env);
+	if (OVERLAYS <= 1) {
+		enableoverlays = 0;
+    } else {
+		const char* enableoverlays_env = getenv("SVKBD_ENABLEOVERLAYS");
+		if (enableoverlays_env != NULL) enableoverlays = atoi(enableoverlays_env);
+	}
 	const char* layers_env = getenv("SVKBD_LAYERS");
 	if (layers_env != NULL) {
 		layer_names_list = malloc(128);
-- 
2.27.0
Received on Fri Jul 24 2020 - 21:50:00 CEST

This archive was generated by hypermail 2.3.0 : Fri Jul 24 2020 - 22:36:32 CEST