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

my %rows = (
	'' => {
		"'" => "\N{COMBINING INVERTED BREVE BELOW}",
		"?" => "ʔ", # was at -
		"<" => "ʲ", # was at ;
		"=" => "↗",
		">" => "ˤ", # was at [
		"\\"=> "\N{COMBINING VERTICAL LINE BELOW}",
		"]" => "ː",
		"§" => "|",

		'"' => "\N{COMBINING RING BELOW}",
		"+" => "↘",
		":" => "ʷ",
		"A" => "ɑ",
		"B" => "β",
		"C" => "ç",
		"D" => "ð",
		"E" => "ə",
		"F" => "ɸ",
		"G" => "ɣ",
		"H" => "ɦ",
		"I" => "ɪ",
		"J" => "ʝ",
		"K" => "ʰ",
		"L" => "ʎ",
		"M" => "ɱ",
		"N" => "ŋ",
		"O" => "ɔ",
		"P" => "\N{COMBINING TILDE}",
		"Q" => "ɜ",
		"R" => "ɾ",
		"S" => "ʃ",
		"T" => "θ",
		"U" => "ʊ",
		"V" => "ʋ",
		"W" => "ʍ",
		"X" => "χ",
		"Z" => "ʒ",
		"Y" => "ʏ",
		"{" => "\N{COMBINING TILDE BELOW}",
		"|" => "ˈ",
		"}" => "ˑ",
		"~" => "~",
		"±" => "‖",
	},

	'!' => {
		"!" => "¡",
		'"' => "\N{COMBINING CARON}",
		"#" => "£",
		'$' => "¤",
		"%" => "⅜",
		"&" => "⅞",
		"'" => "\N{COMBINING CARON BELOW}",
		"(" => "⸩",
		")" => "°",
		"*" => "⸨",
		"+" => "ꜛ",
		"," => "·",
		"-" => "\\",
		"." => "…",
		"/" => "–",
		"0" => "}",
		"1" => "¹",
		"2" => "²",
		"3" => "³",
		"4" => "¼",
		"5" => "\N{COMBINING MACRON BELOW}",
		"6" => "\N{COMBINING BREVE BELOW}",
		"7" => "{",
		"8" => "[",
		"9" => "]",
		":" => "ʸ",
		";" => "ˠ",
		"<" => "×",
		"=" => "ꜜ",
		">" => "÷",
		"?" => "—",
		'@' => "⅛",
		"[" => "\N{COMBINING DIAERESIS}",
		"\\"=> "ˌ",
		"]" => "\N{COMBINING MINUS SIGN BELOW}",
		"^" => "⅝",
		"_" => "¿",
		"`" => "′",
		"a" => "æ",
		"A" => "ɒ",
		"b" => "ʙ",
		"B" => "ɓ",
		"c" => "ɕ",
		"C" => "ȼ",
		"D" => "ɗ",
		"d" => "ɖ",
		"e" => "ɛ",
		"E" => "ɜ",
		"G" => "ɠ",
		"g" => "ɢ",
		"H" => "ʜ",
		"h" => "ɧ",
		"I" => "ɤ",
		"i" => "ɨ",
		"j" => "ɟ",
		"J" => "ʄ",
		"K" => "ʞ",
		"k" => "ʱ",
		"l" => "ɫ",
		"L" => "ɬ",
		"m" => "µ",
		"M" => "⋅",
		"n" => "ɲ",
		"N" => "ɳ",
		"O" => "œ",
		"o" => "ø",
		"p" => "\N{COMBINING PLUS SIGN BELOW}",
		"P" => "‸",
		"Q" => "Ω",
		"q" => "§", # was @
		"r" => "ʁ",
		"R" => "ʀ",
		"S" => "ʆ",
		"t" => "ʈ",
		"u" => "ʉ",
		"U" => "ʌ",
		"V" => "ɴ",
		"v" => "ⱱ",
		"w" => "ɰ",
		"X" => "‹",
		"x" => "«",
		"z" => "ʑ",
		"Z" => "ʓ",
		"y" => "»",
		"Y" => "›",
		"{" => "\N{COMBINING X ABOVE}",
		"|" => "\N{COMBINING BREVE}",
		"}" => "\N{COMBINING MACRON}",
		"~" => "″",
		"§" => "‿",
		"±" => "\N{COMBINING DOUBLE BREVE BELOW}",
	},

	'@' => {
		"!" => "\N{COMBINING DOUBLE ACUTE ACCENT}",
		'"' => "\N{COMBINING CEDILLA}",
		"#" => "\N{COMBINING MACRON}",
		'$' => "\N{COMBINING GRAVE ACCENT}",
		"%" => "\N{COMBINING DOUBLE GRAVE ACCENT}",
		"&" => "\N{COMBINING COMMA ABOVE}",
		"'" => "\N{COMBINING LEFT ANGLE ABOVE}",
		")" => "≠",
		"*" => "\N{COMBINING CIRCUMFLEX ACCENT BELOW}",
		"+" => "*",
		"," => "†",
		"-" => "ʕ",
		"." => "•",
		"/" => "‑",
		"0" => "ʾ",
		"1" => "˥",
		"2" => "˦",
		"3" => "˧",
		"4" => "˨",
		"5" => "˩",
		"6" => "\N{COMBINING DOT BELOW}",
		"7" => "\N{COMBINING DOT ABOVE}",
		"8" => "⟨",
		"9" => "⟩",
		":" => "ˡ",
		";" => "ⁿ",
		"<" => "‡",
		"=" => "ʿ",
		"?" => "­",
		'@' => "\N{COMBINING ACUTE ACCENT}",
		"[" => "\N{COMBINING SQUARE BELOW}",
		"\\"=> "ʼ",
		"]" => "\N{COMBINING SEAGULL BELOW}",
		"^" => "\N{COMBINING INVERTED BREVE}",
		"_" => "ʡ",
		"`" => "⁓",
		"A" => "ɶ",
		"a" => "ɐ",
		"b" => "“",
		"B" => "‘",
		"c" => "ꜣ",
		"C" => "Ꜣ",
		"D" => "\N{COMBINING RIGHT HALF RING BELOW}",
		"d" => "ᶑ",
		"e" => "ɘ",
		"g" => "ʛ",
		"G" => "ɡ",
		"h" => "ħ",
		"i" => "ɵ",
		"I" => "ʫ",
		"K" => "ꞎ",
		"l" => "ʟ",
		"L" => "ɭ",
		"M" => "ǃ",
		"m" => "ʘ",
		"n" => "”",
		"N" => "’",
		"o" => "\N{COMBINING BRIDGE BELOW}",
		"O" => "ɞ",
		"p" => "\N{COMBINING INVERTED BRIDGE BELOW}",
		"q" => "˞",
		"R" => "ɻ",
		"r" => "ɹ",
		"S" => "\N{COMBINING LEFT HALF RING BELOW}",
		"s" => "ʂ",
		"t" => "ǀ",
		"T" => "ǁ",
		"U" => "ʪ",
		"u" => "ɞ",
		"V" => "‚",
		"v" => "„",
		"w" => "ɯ",
		"x" => "ꜥ",
		"X" => "Ꜥ",
		"z" => "ʐ",
		"Z" => "ɮ",
		"y" => "ɥ",
		"{" => "ˀ",
		"|" => "\N{COMBINING OGONEK}",
		"§" => "\N{COMBINING DOUBLE INVERTED BREVE}",
	},

	"#" => {
		"\"" => "\N{COMBINING DOUBLE VERTICAL LINE BELOW}",
		"#"  => "\N{COMBINING DOUBLE VERTICAL LINE BELOW}",
		"\$" => "\N{COMBINING BRIDGE BELOW}",
		"%"  => "\N{COMBINING EQUALS SIGN BELOW}",
		"&"  => "˭",
		"'"  => "\N{COMBINING HOMOTHETIC ABOVE}",
		"("  => "\N{COMBINING RIGHT ARROWHEAD BELOW}",
		")"  => "\N{COMBINING UPWARDS ARROW BELOW}",
		"*"  => "\N{COMBINING LEFT ARROWHEAD BELOW}",
		"+"  => "↑",
		"-"  => "ʢ",
		"/"  => "‐",
		"0"  => "≈",
		"2"  => "○",
		"8"  => "⟪",
		"9"  => "⟫",
		":"  => "\N{COMBINING LEFT RIGHT ARROW BELOW}",
		";"  => "\N{COMBINING ALMOST EQUAL TO ABOVE}",
		"="  => "↓",
		"?"  => "−",
		"\@" => "\N{COMBINING ENCLOSING CIRCLE}",
		"["  => "ˁ",
		"\\" => "\N{COMBINING NOT TILDE ABOVE}",
		"^"  => "ˬ",
		"_"  => "\N{COMBINING DOUBLE RIGHTWARDS ARROW BELOW}",
		"`"  => "―",
		"A"  => "A",
		"a"  => "\N{COMBINING DOWN TACK BELOW}",
		"B"  => "B",
		"b"  => "ʘ",
		"c"  => "ʖ",
		"C"  => "C",
		"d"  => "\N{COMBINING RIGHT TACK BELOW}",
		"D"  => "D",
		"E"  => "E",
		"e"  => "€",
		"F"  => "F",
		"f"  => "ʩ",
		"g"  => "₸",
		"G"  => "G",
		"H"  => "H",
		"h"  => "₴",
		"i"  => "☟",
		"I"  => "I",
		"J"  => "J",
		"k"  => "ℓ",
		"K"  => "K",
		"l"  => "ɺ",
		"L"  => "L",
		"M"  => "M",
		"m"  => "₼",
		"n"  => "ǃ",
		"N"  => "N",
		"O"  => "O",
		"o"  => "☞",
		"P"  => "P",
		"p"  => "𝔓",
		"Q"  => "Q",
		"q"  => "₽",
		"r"  => "ɽ",
		"R"  => "R",
		"S"  => "S",
		"s"  => "\N{COMBINING LEFT TACK BELOW}",
		"t"  => "ǂ",
		"T"  => "T",
		"U"  => "U",
		"u"  => "☝",
		"V"  => "V",
		"w"  => "\N{COMBINING UP TACK BELOW}",
		"W"  => "W",
		"X"  => "X",
		"x"  => "ʗ",
		"y"  => "☜",
		"Y"  => "Z",
		"z"  => "ʇ",
		"Z"  => "Y",
		"{"  => "ʬ",
		"|"  => "\N{COMBINING LEFT ANGLE BELOW}",
		"}"  => "ʭ",
		"~"  => "^",
	},
);

+{
	%{ kbmodes(\%rows) },
	version => '1.0',
	title => 'X-IPA',
	category => 'specialised/ipa',
	intro => join("\n",
		'An input to type phonetic (IPA) <a href="/unicode">unicode</a>',
		'characters, available Xorg map <em>trans</em>.',
		'Designed separately from the more well-known SIL',
		'or <a href="/keyboard/altgr/ipa">UCL</a> implementations.',
	),
	description => [
		"Table of an Xorg keyboard for transcribing",
		"in the International Phonetic Alphabet",
		"with the AltGr modifier key.",
	],
}
