use utf8;
use strict;
use warnings;
use Shiar_Sheet::KeyboardChars 'kbchars';

my %rows = (
	'!' => '¡',
	'1' => 'ƒ',
	'@' => '₧',
	'2' => '‡',
	'#' => '¶',
	'3' => '§',
	'$' => '£',
	'4' => '¢',
	'%' => '¥',
	'5' => 'ÿ',
	'6' => 'α',
	'7' => 'ß',
	'*' => 'Γ',
	'8' => 'γ',
	'(' => 'Ç',
	'9' => 'ç',
	')' => 'Δ',
	'0' => 'δ',
	'-' => '∈',
	'=' => 'ϴ',
	'\\'=> '£',

	'q' => 'â',
	'w' => 'ê',
	'e' => 'î',
	'r' => 'ô',
	't' => 'û',
	'y' => 'á',
	'U' => 'É',
	'u' => 'é',
	'i' => 'í',
	'o' => 'ó',
	'P' => 'Π',
	'p' => 'ú',
	'{' => 'Φ',
	'[' => 'ø',
	'}' => 'Ω',
	']' => 'ω',

	'A' => 'Ä',
	'a' => 'ä',
	's' => 'ë',
	'd' => 'ï',
	'F' => 'Ö',
	'f' => 'ö',
	'G' => 'Ü',
	'g' => 'ü',
	'H' => 'Ã',
	'h' => 'ã',
	'J' => 'Æ',
	'j' => 'æ',
	'K' => 'Ĩ',
	'k' => 'ĩ',
	'L' => 'Õ',
	'l' => 'õ',
	':' => 'Ũ',
	';' => 'ũ',
	'"' => 'Ĳ',
	"'" => 'ĳ',
	'~' => 'Σ',
	'`' => 'σ',

	'z' => 'à',
	'x' => 'è',
	'c' => 'ì',
	'v' => 'ò',
	'b' => 'ù',
	'N' => 'Ñ',
	'n' => 'ñ',
	'm' => 'μ',
	'<' => 'Å',
	',' => 'å',
	'.' => 'ª',
	'?' => '¿',
	'/' => 'º',
);

my %uc = (
	(map { (uc $_ => uc $rows{$_}) } grep {
		!defined $rows{uc $_}
	} keys %rows),
	'|' => '€',
	'M' => 'Ú',
	'+' => 'Ø',
);

my $groups = kbchars({%rows, %uc});
$groups->{def}{''}{$_}[0] .= ' ext' for keys %uc;
$groups->{flag}{ext} = ['anachrone', 'expected uppercase variants if allowed by charset'];

+{
	%{ $groups },
	version => '1.2',
	title => 'MSX code',
	category => 'legacy/msx/latin',
	intro => join("\n",
		'Resulting <a href="/unicode">selection</a>',
		'of equivalent <a href="/charset">Unicode</a> characters',
		"when the <em>code</em> key is pressed on an MSX home computer",
		"(International model such as Toshiba HX10 or Phillips NMS 8245).",
		'See also <a href="/keyboard/altgr/msx-graph">block graphics</a>',
		"from pressing <em>graph</em>.",
	),
	description => [
		"MSX keyboard layout table",
		"with the code modifier key.",
	],
	image => 'data/keyboard/thumb/msxcode.jpg',
	imagealt => 'Code key on a Toshiba HX10 with graph labels',
}
