Commit 312182ce7d33a95b5f87549f4cd5908f916e2131

Ran Benita 2014-10-16T17:55:46

test/data: add files for model=applealu_ansi layout=us Signed-off-by: Ran Benita <ran234@gmail.com>

diff --git a/test/data/symbols/macintosh_vndr/apple b/test/data/symbols/macintosh_vndr/apple
new file mode 100644
index 0000000..551eabc
--- /dev/null
+++ b/test/data/symbols/macintosh_vndr/apple
@@ -0,0 +1,141 @@
+//
+// Keyboard modification for Apple keyboards
+//
+
+partial default modifier_keys
+xkb_symbols "extended" {
+
+    key <KPEQ> { [ KP_Equal ] }; 
+
+// The key in the PC's Insert position is sometimes engraved Help (at least
+// in Switzerland and Great Britain), with Insert sometimes above. But in the
+// US and Canada, it remains Insert. So this should probably be an XkbOption,
+// but I have to do more research.
+// Perhaps Help should be the primary symbol with Insert in the 1st shift-level
+//    key  <INS> { [ Help, Insert ] };
+// The keys next to F12, labeled F13, F14, & F15 generate codes that XFree86
+// claims not to generate. I think they should be equivalent to the PC keys
+// Print Screen / SysRq, Scroll Lock, and Pause. Linux kernel bug?
+//    key <PRSC> { [ F13 ] }; // should be keycode 93 or
+//    key <FK13> { [ F13 ] }; // should be keycode 118
+//    key <SCLK> { [ F14 ] }; // should be keycode 123 or
+//    key <FK14> { [ F14 ] }; // should be keycode 119
+//    key <PAUS> { [ F15 ] }; // should be keycode 127 or
+//    key <FK15> { [ F15 ] }; // should be keycode 120
+};
+
+partial modifier_keys
+xkb_symbols "laptop" {
+
+    include "macintosh_vndr/apple(extended)"
+
+    // The real numlock key on the iBook (shared with F5) works internally to
+    // the keyboard. It illuminates the Num_Lock led and locks the fn-key to
+    // type only the keypad keys on the letter keys (U=4, I=5, O=6, P=*, etc.).
+    // The key in the Num_lock position is engraved with Clear.
+    override key <NMLK> { [ Clear ] };
+    // The key engraved Delete sends BKSP. To get Delete, use Shift-Delete
+    override key <BKSP> { [ BackSpace, Delete ] };
+    // These keyboards only generate a <RALT> when pressing fn+Alt. This makes
+    // it impossible to get to the third shift level on keys that are on
+    // the fn-keypad, so use the Enter key (right of <SPC>) for Mode_switch,
+    // and use fn+Enter (Apple's code for Menu) for KP_Enter.
+    replace key <KPEN> { [ ISO_Level3_Shift ] };
+    modifier_map Mod5  { ISO_Level3_Shift };	
+    // Linux kernel bug with Menu on macs means this doesn't work yet
+//    replace key <MENU> { [ KP_Enter ] }; // should be keycode 117
+};
+
+partial modifier_keys
+xkb_symbols "laptop_bad_switch" {
+    // Kept for backward compatibility
+    include "macintosh_vndr/apple(laptop)"
+};
+
+// Long Aluminium Keyboards
+partial function_keys
+xkb_symbols "alukbd" {
+    // The base is a inet PC keyboard
+    include "pc"
+
+    // Additional Fxx keys
+    key <FK13> { [ F13 ] };
+    key <FK14> { [ F14 ] };
+    key <FK15> { [ F15 ] };
+    key <FK16> { [ F16 ] };
+    key <FK17> { [ F17 ] };
+    key <FK18> { [ F18 ] };
+    key <FK19> { [ F19 ] };
+
+    // On aluminium keyboards, Num_Lock is replace by Clear
+    replace key <NMLK> { [ Clear ] };
+    // CAPS key is always Caps_Lock, even for JIS keyboards
+    replace key <CAPS> { [ Caps_Lock ] };
+
+    // F1..F12 are multimedia keys when used with the 'Fn' key
+    // Make those multimedia actions available via ISO_Level3_Shift too,
+    // it is useful when the Fn key is remapped to something else (e.g. Insert)
+    key <FK01> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, XF86KbdBrightnessDown, NoSymbol, XF86_Switch_VT_1 ]
+    };
+    key <FK02> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, XF86KbdBrightnessUp, NoSymbol, XF86_Switch_VT_2 ]
+    };
+    key <FK03> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, NoSymbol, NoSymbol, XF86_Switch_VT_3 ]
+    };
+    key <FK04> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, NoSymbol, NoSymbol, XF86_Switch_VT_4 ]
+    };
+    key <FK05> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, NoSymbol, NoSymbol, XF86_Switch_VT_5 ]
+    };
+    key <FK06> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, NoSymbol, NoSymbol, XF86_Switch_VT_6 ]
+    };
+    key <FK07> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, XF86AudioPrev, NoSymbol, XF86_Switch_VT_7 ]
+    };
+    key <FK08> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, XF86AudioPlay, NoSymbol, XF86_Switch_VT_8 ]
+    };
+    key <FK09> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, XF86AudioNext, NoSymbol, XF86_Switch_VT_9 ]
+    };
+    key <FK10> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, XF86AudioMute, NoSymbol, XF86_Switch_VT_10 ]
+    };
+    key <FK11> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, XF86AudioLowerVolume, NoSymbol, XF86_Switch_VT_11 ]
+    };
+    key <FK12> {
+      type= "FOUR_LEVEL_X",
+      symbols[Group1]= [ NoSymbol, XF86AudioRaiseVolume, NoSymbol, XF86_Switch_VT_12 ]
+    };
+};
+
+// Aluminium Keyboard: make F13, F14, F15 PC-ish (Print, Scroll_Lock, Pause)
+partial function_keys keypad_keys
+xkb_symbols "alupckeys" {
+    key <FK13> {
+      type= "PC_ALT_LEVEL2",
+      symbols[Group1]= [ Print, Sys_Req ]
+    };
+    key <FK14> { [ Scroll_Lock ] };
+    key <FK15> {
+      type= "PC_CONTROL_LEVEL2",
+      symbols[Group1]= [ Pause, Break ]
+    };
+    override key <NMLK> { [ Num_Lock, Pointer_EnableKeys ] };
+};
diff --git a/test/data/symbols/macintosh_vndr/us b/test/data/symbols/macintosh_vndr/us
new file mode 100644
index 0000000..81e4b77
--- /dev/null
+++ b/test/data/symbols/macintosh_vndr/us
@@ -0,0 +1,145 @@
+// symbols definition for a Macintosh "Extended" keyboard
+
+xkb_symbols "extended" {
+
+    name[Group1]= "USA";
+    key <ESC>  {	[ Escape			]	};
+
+    key <TLDE> {	[     grave,	asciitilde	]	};
+    key <AE01> {	[	  1,	exclam 		]	};
+    key <AE02> {	[	  2,	at		]	};
+    key <AE03> {	[	  3,	numbersign	]	};
+    key <AE04> {	[	  4,	dollar		]	};
+    key <AE05> {	[	  5,	percent		]	};
+    key <AE06> {	[	  6,	asciicircum	]	};
+    key <AE07> {	[	  7,	ampersand	]	};
+    key <AE08> {	[	  8,	asterisk	]	};
+    key <AE09> {	[	  9,	parenleft	]	};
+    key <AE10> {	[	  0,	parenright	]	};
+    key <AE11> {	[     minus,	underscore	]	};
+    key <AE12> {	[     equal,	plus		]	};
+
+    key <AD01> {	[	  q,	Q 		]	};
+    key <AD02> {	[	  w,	W		]	};
+    key <AD03> {	[	  e,	E		]	};
+    key <AD04> {	[	  r,	R		]	};
+    key <AD05> {	[	  t,	T		]	};
+    key <AD06> {	[	  y,	Y		]	};
+    key <AD07> {	[	  u,	U		]	};
+    key <AD08> {	[	  i,	I		]	};
+    key <AD09> {	[	  o,	O		]	};
+    key <AD10> {	[	  p,	P		]	};
+    key <AD11> {	[ bracketleft,	braceleft	]	};
+    key <AD12> {	[ bracketright,	braceright	]	};
+    key <BKSL> {	[ backslash,	bar		]	};
+
+    key <AC01> {	[	  a,	A 		]	};
+    key <AC02> {	[	  s,	S		]	};
+    key <AC03> {	[	  d,	D		]	};
+    key <AC04> {	[	  f,	F		]	};
+    key <AC05> {	[	  g,	G		]	};
+    key <AC06> {	[	  h,	H		]	};
+    key <AC07> {	[	  j,	J		]	};
+    key <AC08> {	[	  k,	K		]	};
+    key <AC09> {	[	  l,	L		]	};
+    key <AC10> {	[ semicolon,	colon		]	};
+    key <AC11> {	[ apostrophe,	quotedbl	]	};
+
+    key <AB01> {	[	  z,	Z 		]	};
+    key <AB02> {	[	  x,	X		]	};
+    key <AB03> {	[	  c,	C		]	};
+    key <AB04> {	[	  v,	V		]	};
+    key <AB05> {	[	  b,	B		]	};
+    key <AB06> {	[	  n,	N		]	};
+    key <AB07> {	[	  m,	M		]	};
+    key <AB08> {	[     comma,	less		]	};
+    key <AB09> {	[    period,	greater		]	};
+    key <AB10> {	[     slash,	question	]	};
+
+    key <SPCE> {	[  space			]	};
+
+    include "eurosign(e)"
+    include "keypad"
+
+    key <KPEQ> {	[  equal			]	};
+};
+
+hidden
+xkb_symbols "oldmac" {
+
+    include "macintosh_vndr/us(extended)"
+
+    // Begin "Function" section
+    key <FK01> {	[  F1		]	};
+    key <FK02> {	[  F2		]	};
+    key <FK03> {	[  F3		]	};
+    key <FK04> {	[  F4		]	};
+    key <FK05> {	[  F5		]	};
+    key <FK06> {	[  F6		]	};
+    key <FK07> {	[  F7		]	};
+    key <FK08> {	[  F8		]	};
+    key <FK09> {	[  F9		]	};
+    key <FK10> {	[  F10		]	};
+    key <FK11> {	[  F11		]	};
+    key <FK12> {	[  F12		]	};
+    key <FK13> {	[  Print	]	};
+    key <FK14> {	[  Scroll_Lock	]	};
+    key <FK15> {	[  Pause	]	};
+    // End "Function" section
+
+    // Begin "Editing" section
+    key  <INS> {	[  Insert	]	};
+    key <HOME> {	[  Home		]	};
+    key <PGUP> {	[  Prior	]	};
+    key <DELE> {	[  Delete	]	};
+    key  <END> {	[  End		]	};
+    key <PGDN> {	[  Next		]	};
+
+    key   <UP> {	[  Up		]	};
+    key <LEFT> {	[  Left		]	};
+    key <DOWN> {	[  Down		]	};
+    key <RGHT> {	[  Right	]	};
+    // End "Editing" section
+
+    key <BKSP> {	[ BackSpace	]	};
+    key  <TAB> {	[ Tab,	ISO_Left_Tab ]	};
+    key <RTRN> {	[ Return	]	};
+    key <CAPS> {	[ Caps_Lock	]	};
+    key <NMLK> {	[ Num_Lock, Pointer_EnableKeys ] };
+
+    // Begin "Modifier" section
+    key <LFSH> {	[  Shift_L	]	};
+    key <RTSH> {	[  Shift_R	]	};
+    key <LCTL> {	[  Control_L	]	};
+    key <RCTL> {	[  Control_R	]	};
+    key <LALT> {	[  Alt_L, Meta_L ]	};
+    key <RALT> {	[  Alt_R, Meta_R ]	};
+    key <LWIN> {	[  Super_L	]	};
+    key <RWIN> {	[  Super_R	]	};
+    // End "Modifier" section
+
+    // begin modifier mappings
+    modifier_map Shift  { Shift_L, Shift_R };
+    modifier_map Lock   { Caps_Lock };
+    modifier_map Control{ Control_L, Control_R };
+    modifier_map Mod2   { Num_Lock };
+
+    //  Fake keys for virtual<->real modifiers mapping 
+    key <LVL3> {	[ ISO_Level3_Shift	]	};
+    key <MDSW> {	[ Mode_switch 		]	};
+    modifier_map Mod5   { <LVL3>, <MDSW> };
+
+    key <ALT>  {	[ NoSymbol, Alt_L	]	};
+    modifier_map Mod1   { <ALT>, <LALT> };
+
+    key <META> {	[ NoSymbol, Meta_L	]	};
+    modifier_map Mod1   { <META> };
+
+    key <SUPR> {	[ NoSymbol, Super_L	]	};
+    modifier_map Mod4   { <SUPR> };
+
+    key <HYPR> {	[ NoSymbol, Hyper_L	]	};
+    modifier_map Mod4   { <HYPR> };
+    // end modifier mappings
+
+};
diff --git a/test/data/sync.sh b/test/data/sync.sh
index 206231a..10001bc 100755
--- a/test/data/sync.sh
+++ b/test/data/sync.sh
@@ -23,6 +23,8 @@ for file in \
     symbols/capslock \
     symbols/latin \
     symbols/level5 \
+    symbols/macintosh_vndr/apple \
+    symbols/macintosh_vndr/us \
     symbols/us \
     symbols/nbsp \
     symbols/il \