use utf8;
use strict;
use warnings;

my %dyalogx = (
	'Q' => '⍰',
	'R' => '⌾',
	'G' => '⍢',
	'B' => '⍭',
	'N' => '⍡',
	'M' => '∥',
);
our %rows = (
	'~' => '⌺',
	'!' => '⌶',
	'@' => '⍫',
	'#' => '⍒',
	'$' => '⍋',
	'%' => '⌽',
	'^' => '⍉',
	'&' => '⊖',
	'*' => '⍟',
	'(' => '⍱',
	')' => '⍲',
	'_' => '!',
	'+' => '⌹',
	'`' => '⋄',
	'1' => '¨',
	'2' => '¯',
	'3' => '<',
	'4' => '≤',
	'5' => '=',
	'6' => '≥',
	'7' => '>',
	'8' => '≠',
	'9' => '∨',
	'0' => '∧',
	'-' => '×',
	'=' => '÷',
	'E' => '⍷',
	'T' => '⍨',
	'I' => '⍸',
	'O' => '⍥',
	'P' => '⍣',
	'{' => '⍞',
	'}' => '⍬',
	'|' => '⊣',
	'q' => '?',
	'w' => '⍵',
	'e' => '∊',
	'r' => '⍴',
	't' => '∼', # ~
	'y' => '↑',
	'u' => '↓',
	'i' => '⍳',
	'o' => '○',
	'p' => '⋆', # *
	'[' => '←',
	']' => '→',
	'\\'=> '⊢',
	'J' => '⍤',
	'K' => '⌸',
	'L' => '⌷',
	':' => '≡',
	'"' => '≢',
	'a' => '⍺',
	's' => '⌈',
	'd' => '⌊',
	'f' => '_',
	'g' => '∇',
	'h' => '∆',
	'j' => '∘',
	'k' => "'",
	'l' => '⎕',
	';' => '⍎',
	"'" => '⍕',
	'Z' => '⊆',
	'<' => '⍪',
	'>' => '⍙',
	'?' => '⍠',
	'z' => '⊂',
	'x' => '⊃',
	'c' => '∩',
	'v' => '∪',
	'b' => '⊥',
	'n' => '⊤',
	'm' => '|',
	',' => '⍝',
	'.' => '⍀',
	'/' => '⌿',
	%dyalogx,
);

my $groups = do 'keyboard/altgr/groups.inc.pl';
$groups->{def}{''}{$_} .= ' ext' for keys %dyalogx;
$groups->{flag}{ext} = ['extended', 'optional operators not available in all variants'];

+{
	%{$groups},
	version => '1.0',
	title => 'APL',
	intro => join("\n",
		'Resulting <a href="/charset">Unicode</a> characters',
		'of a typical <a href="/apl">APL</a> keyboard layout',
		'derived from IBM System/360 terminals.',
		'Usually obtained by prefixing <code>`</code> (Dyalog)',
		'and/or pressing AltGr (APLX).',
	),
	description => [
		'Typical IBM-derived APL keyboard layout,',
		'as found in APLX and Dyalog implementations.',
	],
	image => 'keyboard/altgr/unicomp-apl.jpg',
}
