From: Mischa POSLAWSKY Date: Mon, 25 Mar 2024 03:31:22 +0000 (+0100) Subject: keyboard/altgr/index: count root meta keys as distinct mode X-Git-Tag: v1.19~17 X-Git-Url: http://git.shiar.net/sheet.git/commitdiff_plain/159550a310db39c79c32ace87d88b036ccb596b8?ds=sidebyside keyboard/altgr/index: count root meta keys as distinct mode Prevent abnormally large unigraph character numbers in comparison graph due to overcomplete 3rd-4th rows. --- diff --git a/keyboard/altgr/index.inc.pl b/keyboard/altgr/index.inc.pl index 30783f7..2308e14 100644 --- a/keyboard/altgr/index.inc.pl +++ b/keyboard/altgr/index.inc.pl @@ -16,6 +16,14 @@ for my $name (map {@{$_}} values %cat) { $cat{$name} = \%row; $keys->{mode} //= {'' => undef}; + + if ($keys->{def}{''}{'+a'}) { + # move root +meta keys to distinct mode + $keys->{mode}{"\e"} = '+'; + /^\+./ and $keys->{def}{"\e"}{$_} = delete $keys->{def}{''}{$_} + for keys %{ $keys->{def}{''} }; + } + for my $mode (keys %{ $keys->{mode} }) { $row{def}{''}{$_} = $keys->{def}{''}{$_} for $mode || (); $row{inventory}{$mode}{$_}++ for grep { /^g[2-9]/ } map { s/ (?!ext).*//r } map {$_->[0]}