~mil/sxmo-devel

This thread contains a patchset. You're looking at the original emails, but you may wish to use the patch review UI. Review patch
6 3

I tried to enhance our sxmo keyboard (here's my proposition)

Details
Message ID
<20210306123642.4253-1-contact@stacyharper.net>
DKIM signature
pass
Download raw message
Hello everyone !

I took some time to work on an svkbd layout that would satisfy me.

tl;dr here is the v1 demonstration:

https://tube.misterbanal.net/videos/watch/a308ab44-197c-4e3f-b501-61fda2b55ad0

Some explanations:

My goal is to have a lazy default layout (no ctrl, alt or some kind of
modifiers) with easy access to most of the symbols. I took my old
smartphone to see what works.

I had to make two patches to svkbd:

- To choose which keys are overlayed with overlays. With this
  modification, I trully can choose where the overlay show itself.
- To allow default modifier on keys (insert "?" instead of "/" without
  pressing the shift modifiers)

Those patches really are minimal and I trully think it could be merged
upstream.

A more poweruser keyboard (the old one) is still available for terminal
related actions.

I will test this layout for some time to see what is not working.
Fell free to try it, hack it, and give feedbacks.

Stacy

[PATCH 1/3] Allow Key to have default modifier

Details
Message ID
<20210306123642.4253-2-contact@stacyharper.net>
In-Reply-To
<20210306123642.4253-1-contact@stacyharper.net> (view parent)
DKIM signature
pass
Download raw message
Patch: +19 -9
From: Reed Wade <reedwade@misterbanal.net>

This allow key definitions as :

{ "?", XK_slash, 1, XK_Shift_L },

Which will press <S-/> wich output `?`

Signed-off-by: Reed Wade <reedwade@misterbanal.net>
---
 svkbd.c | 28 +++++++++++++++++++---------
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/svkbd.c b/svkbd.c
index d8c5c2d..aa735e2 100644
--- a/svkbd.c
+++ b/svkbd.c
@@ -46,6 +46,7 @@ typedef struct {
	char *label;
	KeySym keysym;
	unsigned int width;
	KeySym modifier;
	int x, y, w, h;
	Bool pressed;
	Bool highlighted;
@@ -175,14 +176,20 @@ buttonpress(XEvent *e)

	ispressing = True;

	for (i = 0; i < LENGTH(buttonmods); i++) {
		if (ev->button == buttonmods[i].button) {
			mod = buttonmods[i].mod;
			break;
	if (!(k = findkey(ev->x, ev->y)))
		return;

	if (k->modifier)
		mod = k->modifier;
	else
		for (i = 0; i < LENGTH(buttonmods); i++) {
			if (ev->button == buttonmods[i].button) {
				mod = buttonmods[i].mod;
				break;
			}
		}
	}
	if ((k = findkey(ev->x, ev->y)))
		press(k, mod);

	press(k, mod);
}

void
@@ -204,8 +211,10 @@ buttonrelease(XEvent *e)

	if (ev->x < 0 || ev->y < 0) {
		unpress(NULL, mod);
	} else {
		if ((k = findkey(ev->x, ev->y)))
	} else if ((k = findkey(ev->x, ev->y))) {
		if (k->modifier)
			unpress(k, k->modifier);
		else
			unpress(k, mod);
	}
}
@@ -881,6 +890,7 @@ showoverlay(int idx)
			j++;
		keys[j].label = overlay[i].label;
		keys[j].keysym = overlay[i].keysym;
		keys[j].modifier = overlay[i].modifier;
	}
	currentoverlay = idx;
	overlaykeysym = ispressingkeysym;
-- 
2.30.1

[PATCH 2/3] Use overlay width as a skip x keys

Details
Message ID
<20210306123642.4253-3-contact@stacyharper.net>
In-Reply-To
<20210306123642.4253-1-contact@stacyharper.net> (view parent)
DKIM signature
pass
Download raw message
Patch: +2 -0
From: Reed Wade <reedwade@misterbanal.net>

Usefull if you want to skip somekeys that you want still displayed under
the overlay.

Signed-off-by: Reed Wade <reedwade@misterbanal.net>
---
 svkbd.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/svkbd.c b/svkbd.c
index aa735e2..80b89de 100644
--- a/svkbd.c
+++ b/svkbd.c
@@ -888,6 +888,8 @@ showoverlay(int idx)
			break;
		while (keys[j].keysym == 0)
			j++;
		if (overlay[i].width)
			j += overlay[i].width;
		keys[j].label = overlay[i].label;
		keys[j].keysym = overlay[i].keysym;
		keys[j].modifier = overlay[i].modifier;
-- 
2.30.1

[PATCH 3/3] Add an sxmo config

Details
Message ID
<20210306123642.4253-4-contact@stacyharper.net>
In-Reply-To
<20210306123642.4253-1-contact@stacyharper.net> (view parent)
DKIM signature
pass
Download raw message
Patch: +486 -0
From: Reed Wade <reedwade@misterbanal.net>

Signed-off-by: Reed Wade <reedwade@misterbanal.net>
---
 layout.sxmo.h | 486 ++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 486 insertions(+)
 create mode 100644 layout.sxmo.h

diff --git a/layout.sxmo.h b/layout.sxmo.h
new file mode 100644
index 0000000..60b8b39
--- /dev/null
+++ b/layout.sxmo.h
@@ -0,0 +1,486 @@
#define KEYS SMART_KEYS

#define LAZY_KEYS 40

static Key keys_lazy_en[LAZY_KEYS] = {
	{ 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 },

	{ 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_apostrophe, 1 },

	{ 0 },

	{ "↑", XK_Shift_L, 3 },
	{ 0, XK_z, 2 },
	{ 0, XK_x, 2 },
	{ 0, XK_c, 2 },
	{ 0, XK_v, 2 },
	{ 0, XK_b, 2 },
	{ 0, XK_n, 2 },
	{ 0, XK_m, 2 },
	{ "⌫", XK_BackSpace, 3 },

	{ 0 },

	{ "?123", XK_Cancel, 3 },
	{ "-", XK_minus, 2 },
	{ "☺", 0x101f642, 2 },
	{ "", XK_space, 8 },
	{ ".", XK_period, 2 },
	{ "↲Enter", XK_Return, 3 }
};

static Key keys_symbols[LAZY_KEYS] = {
	{ "1", XK_1, 1 },
	{ "2", 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 },

	{ "!", XK_1, 1, XK_Shift_L },
	{ "@", XK_2, 1, XK_Shift_L },
	{ "#", XK_3, 1, XK_Shift_L },
	{ "$", XK_4, 1, XK_Shift_L },
	{ "%", XK_5, 1, XK_Shift_L },
	{ "^", XK_6, 1, XK_Shift_L },
	{ "&", XK_7, 1, XK_Shift_L },
	{ "*", XK_8, 1, XK_Shift_L },
	{ "(", XK_9, 1, XK_Shift_L },
	{ ")", XK_0, 1, XK_Shift_L },

	{ 0 },

	{ "↑", XK_Shift_L, 3 },
	{ "~", XK_grave, 2, XK_Shift_L },
	{ "\\", XK_backslash, 2 },
	{ "|", XK_backslash, 2, XK_Shift_L },
	{ "←", XK_Left, 2 },
	{ "↓", XK_Down, 2 },
	{ "↑", XK_Up, 2 },
	{ "→", XK_Right, 2 },
	{ "⌫", XK_BackSpace, 3 },

	{ 0 },

	{ "abc", XK_Mode_switch, 3 },
	{ "-", XK_minus, 2 },
	{ "↺", XK_Cancel, 2 },
	{ "", XK_space, 8 },
	{ ".", XK_period, 2 },
	{ "↲Enter", XK_Return, 3 }
};

#define SMART_KEYS 43

static Key keys_functions[SMART_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 },

	{ "≅", 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 },

	{ "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 },
	{ "⌫", XK_BackSpace, 2 },

	{ 0 },

	{ "↺", 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_smart_en[SMART_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 },

	{ "'\"", 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 },

	{ "abc", 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 },
	{ "⌫", XK_BackSpace, 2 },

	{ 0 },

	{ "↺", 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 DIALER_KEYS 27

static Key keys_dialer[DIALER_KEYS] = {
	{ "Esc", XK_Escape, 1 },
	{ "1!", XK_1, 1 },
	{ "2@", XK_2, 1 },
	{ "3#", XK_3, 1 },
	{ "⌫", XK_BackSpace, 2 },

	{ 0 },

	{ "Shift", XK_Shift_L, 1 },
	{ "4$", XK_4, 1 },
	{ "5%", XK_5, 1 },
	{ "6^", XK_6, 1 },
	{ "-_", XK_minus, 1 },
	{ ",<", XK_comma, 1 },

	{ 0 },

	{ "abc", XK_Mode_switch, 1 },
	{ "7&", XK_7, 1 },
	{ "8*", XK_8, 1 },
	{ "9(", XK_9, 1 },
	{ "=+", XK_equal, 1 },
	{ "/?", XK_slash, 1 },

	{ 0 },

	{ "↺", XK_Cancel, 1},
	{ "", XK_space, 1 },
	{ "0)", XK_0, 1 },
	{ ".>", XK_period, 1 },
	{ "↲ Enter", XK_Return, 2},
};

#define OVERLAYS 189

static Key overlay[OVERLAYS] = {
	{ 0, XK_a },
	{ "à", XK_agrave },
	{ "á", XK_aacute },
	{ "â", XK_acircumflex },
	{ "ä", XK_adiaeresis },
	{ "ą", XK_aogonek },
	{ "ã", XK_atilde },
	{ "ā", XK_amacron },
	{ "ă", XK_abreve },
	{ "å", XK_aring },
	{ "æ", XK_ae },
	{ 0, XK_Cancel },

	{ 0, XK_e },
	{ "è", XK_egrave },
	{ "é", XK_eacute },
	{ "ê", XK_ecircumflex },
	{ "ë", XK_ediaeresis },
	{ "ę", XK_eogonek },
	{ "ē", XK_emacron },
	{ "ė", XK_eabovedot },
	{ 0, XK_Cancel },

	{ 0, XK_y },
	{ "ỳ", XK_ygrave },
	{ "ý", XK_yacute },
	{ "ŷ", XK_ycircumflex },
	{ "ÿ", XK_ydiaeresis },
	{ 0, XK_Cancel },

	{ 0, XK_u },
	{ "ù", XK_ugrave },
	{ "ú", XK_uacute },
	{ "û", XK_ucircumflex },
	{ "ü", XK_udiaeresis },
	{ "ų", XK_uogonek },
	{ "ū", XK_umacron },
	{ "ů", XK_uring},
	{ "ŭ", XK_ubreve},
	{ "ű", XK_udoubleacute },
	{ 0, XK_Cancel },

	{ 0, XK_i },
	{ "ì", XK_igrave },
	{ "í", XK_iacute },
	{ "î", XK_icircumflex },
	{ "ï", XK_idiaeresis },
	{ "į", XK_iogonek },
	{ "ī", XK_imacron },
	{ "ı", XK_idotless },
	{ 0, XK_Cancel },


	{ 0, XK_o },
	{ "ò", XK_ograve },
	{ "ó", XK_oacute },
	{ "ô", XK_ocircumflex },
	{ "ö", XK_odiaeresis },
	{ "ǫ", XK_ogonek },
	{ "õ", XK_otilde },
	{ "ō", XK_omacron },
	{ "ø", XK_oslash },
	{ "ő", XK_odoubleacute },
	{ "œ", XK_oe },
	{ 0, XK_Cancel },

	{ 0, XK_d },
	{ "ď", XK_dcaron },
	{ "ð", XK_eth },
	{ 0, XK_Cancel },

	{ 0, XK_c },
	{ "ç", XK_ccedilla },
	{ "ĉ", XK_ccircumflex },
	{ "č", XK_ccaron },
	{ "ć", XK_cacute },
	{ 0, XK_Cancel },

	{ 0, XK_s },
	{ "ş", XK_scedilla },
	{ "ŝ", XK_scircumflex },
	{ "š", XK_scaron },
	{ "ś", XK_sacute },
	{ "ß", XK_ssharp },
	{ 0, XK_Cancel },

	{ 0, XK_z },
	{ "ž", XK_zcaron },
	{ "ż", XK_zabovedot },
	{ 0, XK_Cancel },

	{ 0, XK_n },
	{ "ñ", XK_ntilde },
	{ "ń", XK_nacute },
	{ "ň", XK_ncaron },
	{ 0, XK_Cancel },

	{ 0, XK_t },
	{ "ț", XK_tcedilla },
	{ "ť", XK_tcaron },
	{ "þ", XK_thorn },
	{ 0, XK_Cancel },

	{ 0, XK_g },
	{ "ĝ", XK_gcircumflex },
	{ "ğ", XK_gbreve },
	{ 0, XK_Cancel },

	{ 0, XK_h },
	{ "ĥ", XK_hcircumflex },
	{ 0, XK_Cancel },

	{ 0, XK_j },
	{ "ĵ", XK_jcircumflex },
	{ 0, XK_Cancel },

	{ 0, XK_l },
	{ "ł", XK_lstroke },
	{ "ľ", XK_lcaron },
	{ 0, XK_Cancel },

	{ 0, XK_r },
	{ "ř", XK_rcaron },
	{ 0, XK_Cancel },

	{ 0, XK_Cyrillic_softsign },
	{ "ъ", XK_Cyrillic_hardsign },
	{ 0, XK_Cancel },

	{ 0, XK_Cyrillic_ie },
	{ "ё", XK_Cyrillic_io },
	{ "э", XK_Cyrillic_e },
	{ "Є", XK_Ukrainian_ie },
	{ 0, XK_Cancel },

	{ 0, XK_Cyrillic_i },
	{ "і", XK_Ukrainian_i },
	{ "ї", XK_Ukrainian_yi },
	{ 0, XK_Cancel },

	{ 0, XK_Cyrillic_u },
	{ "ў", XK_Byelorussian_shortu },
	{ 0, XK_Cancel },

	{ 0, XK_Cyrillic_shorti },
	{ "ј", XK_Cyrillic_je },
	{ 0, XK_Cancel },

	{ 0, XK_Cyrillic_el },
	{ "љ", XK_Cyrillic_lje },
	{ 0, XK_Cancel },

	{ 0, XK_Cyrillic_en },
	{ "њ", XK_Cyrillic_nje },
	{ 0, XK_Cancel },

	{ 0, XK_Cyrillic_tse },
	{ "џ", XK_Cyrillic_dzhe },
	{ 0, XK_Cancel },

	{ 0, XK_Cyrillic_che },
	{ "ћ", XK_Serbian_tshe },
	{ "ђ", XK_Serbian_dje },
	{ 0, XK_Cancel },

	{ "🙂", 0x101f642 },
	{ "😀", 0x101f600 },
	{ "😁", 0x101f601 },
	{ "😂", 0x101f602 },
	{ "😃", 0x101f603 },
	{ "😄", 0x101f604 },
	{ "😅", 0x101f605 },
	{ "😆", 0x101f606 },
	{ "😇", 0x101f607 },
	{ "😈", 0x101f608 },
	{ "😉", 0x101f609 },
	{ "😊", 0x101f60a },
	{ "😋", 0x101f60b },
	{ "😌", 0x101f60c },
	{ "😍", 0x101f60d },
	{ "😎", 0x101f60e },
	{ "😏", 0x101f60f },
	{ "😐", 0x101f610 },
	{ "😒", 0x101f612 },
	{ "😓", 0x101f613 },
	{ "😛", 0x101f61b },
	{ "😮", 0x101f62e, 1 }, // skip shift
	{ "😟", 0x101f61f },
	{ "😟", 0x101f620 },
	{ "😢", 0x101f622 },
	{ "😭", 0x101f62d },
	{ "😳", 0x101f633 },
	{ "😴", 0x101f634 },
	{ 0, XK_Cancel },

	{ ".", XK_period, },
	{ "!", XK_1, 27, XK_Shift_L },
	{ "?", XK_slash, 0, XK_Shift_L },
	{ ",", XK_comma, 0 },
	{ 0, XK_Cancel },

	{ "-", XK_minus },
	{ "_", XK_minus, 23, XK_Shift_L },
	{ "+", XK_plus, 0, XK_Shift_L },
	{ "*", XK_8, 0, XK_Shift_L },
	{ "=", XK_plus },
	{ 0, XK_Cancel },

	{ "'", XK_apostrophe },
	{ "{", XK_bracketleft, 6, XK_Shift_L },
	{ "}", XK_bracketright, 0, XK_Shift_L },
	{ "[", XK_bracketleft, 0 },
	{ "]", XK_bracketright, 0 },
	{ "<", XK_comma, 5, XK_Shift_L },
	{ ">", XK_period, 0, XK_Shift_L },
	{ "`", XK_grave, 0 },
	{ "\"", XK_apostrophe, 0, XK_Shift_L },
	{ "'", XK_apostrophe },
	{ 0, XK_Cancel },
};

#define LAYERS 5

static char* layer_names[LAYERS] = {
	"lazy en",
	"symbols",
	"smart en",
	"functions",
	"dialer",
};

static Key* available_layers[LAYERS] = {
	keys_lazy_en,
	keys_symbols,
	keys_smart_en,
	keys_functions,
	keys_dialer,
};

Buttonmod buttonmods[] = {
	{ XK_Shift_L, Button2 },
	{ XK_Alt_L, Button3 },
};
-- 
2.30.1

Re: [PATCH 1/3] Allow Key to have default modifier

Details
Message ID
<20210306142258.xnlntcx5e4j7bcmz@worker.anaproy.lxd>
In-Reply-To
<20210306123642.4253-2-contact@stacyharper.net> (view parent)
DKIM signature
missing
Download raw message
Thanks! I have applied the first two patches to my svkbd development
tree (https://git.sr.ht/~proycon/svkbd/log/dev), which I eventually hope
to take upstream after I'm done. It's probably easiest if I collect and
merge the changes first, so keep on posting them to our list.

Using the width property for the overlays is a clever trick I like, the
default modifier also makes sense.

I haven't merged your layout itself yet, but there's always room for
layouts I think, but it probably needs a more specific name than 'sxmo'
;). I see your layout is more minimalistic whilst I am
going in the other direction with a fuller layout (see
https://todo.sr.ht/~mil/sxmo-tickets/190 and https://download.anaproy.nl/svkbd4.png).


On 21-03-06 01:36, Stacy Harper wrote:
> From: Reed Wade <reedwade@misterbanal.net>
>
> This allow key definitions as :
>
> { "?", XK_slash, 1, XK_Shift_L },
>
> Which will press <S-/> wich output `?`
>
> Signed-off-by: Reed Wade <reedwade@misterbanal.net>
> ---
>  svkbd.c | 28 +++++++++++++++++++---------
>  1 file changed, 19 insertions(+), 9 deletions(-)
>
> diff --git a/svkbd.c b/svkbd.c
> index d8c5c2d..aa735e2 100644
> --- a/svkbd.c
> +++ b/svkbd.c
> @@ -46,6 +46,7 @@ typedef struct {
>  	char *label;
>  	KeySym keysym;
>  	unsigned int width;
> +	KeySym modifier;
>  	int x, y, w, h;
>  	Bool pressed;
>  	Bool highlighted;
> @@ -175,14 +176,20 @@ buttonpress(XEvent *e)
>
>  	ispressing = True;
>
> -	for (i = 0; i < LENGTH(buttonmods); i++) {
> -		if (ev->button == buttonmods[i].button) {
> -			mod = buttonmods[i].mod;
> -			break;
> +	if (!(k = findkey(ev->x, ev->y)))
> +		return;
> +
> +	if (k->modifier)
> +		mod = k->modifier;
> +	else
> +		for (i = 0; i < LENGTH(buttonmods); i++) {
> +			if (ev->button == buttonmods[i].button) {
> +				mod = buttonmods[i].mod;
> +				break;
> +			}
>  		}
> -	}
> -	if ((k = findkey(ev->x, ev->y)))
> -		press(k, mod);
> +
> +	press(k, mod);
>  }
>
>  void
> @@ -204,8 +211,10 @@ buttonrelease(XEvent *e)
>
>  	if (ev->x < 0 || ev->y < 0) {
>  		unpress(NULL, mod);
> -	} else {
> -		if ((k = findkey(ev->x, ev->y)))
> +	} else if ((k = findkey(ev->x, ev->y))) {
> +		if (k->modifier)
> +			unpress(k, k->modifier);
> +		else
>  			unpress(k, mod);
>  	}
>  }
> @@ -881,6 +890,7 @@ showoverlay(int idx)
>  			j++;
>  		keys[j].label = overlay[i].label;
>  		keys[j].keysym = overlay[i].keysym;
> +		keys[j].modifier = overlay[i].modifier;
>  	}
>  	currentoverlay = idx;
>  	overlaykeysym = ispressingkeysym;
> --
> 2.30.1
Details
Message ID
<20210306154635.GA27649@mail.hallyn.com>
In-Reply-To
<20210306123642.4253-1-contact@stacyharper.net> (view parent)
DKIM signature
missing
Download raw message
On Sat, Mar 06, 2021 at 01:36:39PM +0100, Stacy Harper wrote:
> 
> Hello everyone !
> 
> I took some time to work on an svkbd layout that would satisfy me.
> 
> tl;dr here is the v1 demonstration:
> 
> https://tube.misterbanal.net/videos/watch/a308ab44-197c-4e3f-b501-61fda2b55ad0

So I see you tapping away at the 'switch layout' button several times to get
it to switch once, which reminds me of my own frustration with that button.
Would be nice if swipe-right and swipe-left would go fwd/back through the list
of layouts.
Details
Message ID
<2ENBISEKLQSUP.1YIXFVIPH9FBI@eddiebarraco.fr>
In-Reply-To
<20210306154635.GA27649@mail.hallyn.com> (view parent)
DKIM signature
pass
Download raw message
> So I see you tapping away at the 'switch layout' button several times to get
> it to switch once, which reminds me of my own frustration with that button.
> Would be nice if swipe-right and swipe-left would go fwd/back through the list
> of layouts.

Yes completely right :D Hard to press this button with my left hand
while holding another smartphone

Plus, I think I'll patch svkbd to permit an optional argument to the
XK_Cancel button to swith to a specific layer index.

We could then have better alternatives than "go next" and "go first"
layer keys.
Reply to thread Export thread (mbox)