[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: new Apple symbols map (exposes kernel buglets?)



On Fri, 2003-08-22 at 09:55, Frank Murphy wrote: 
>   This should be interesting to anyone with an Apple laptop with the mimized 
> keyboard <apple(laptop)>. It's also mildly interesting to anyone with an 
> Apple desktop keyboard (though it only enables the Help key at the moment) 
> <apple(extended)>. 

Can't the Help key simply be fixed in the macintosh symbols? Are there
Mac keyboards where this is actually an Insert key?

> Unfortunately, I can't seem to configure XFree86 to take this (or any) 
> XkbSymbols option. If someone figures it out, please let me know.

Tell me about figuring out why something doesn't work with Xkb... I had
to manually strace xkbcomp to find out what was wrong while working on
the attached patch. Tell me what you think about it, it works with

	Option	"XkbModel"	"powerbook"	(or "ibook")

and

	Option	"XkbOptions"	"altwin:macos_alt"

BTW, where do you get the Multi_key definition from? Can't seem to find
it here.


>   Also, while trying to create this map, I've run across some buglets (perhaps 
> in the kernel keyboard code) that prevent this map from being complete. I've 
> noted the problems in the file, but basically, the laptop 'Menu' key, and the 
> externded keyboards F13, F14, & F15 keys don't give the expected keycodes. 
> The keycode for the right logo key was broken in kernel 2.4.19, but is fixed 
> in 2.4.21, but I can't find the location of the fix.

You may want to pass this info on to linuxppc-dev and/or an input layer
list.

Speaking of bugs, fn+command generates the same keycode as the eject key
in X here, but not in console (showkey shows several keycodes for the
eject key) - maybe related to the keypad equal bug you fixed recently?


-- 
Earthling Michel Dänzer   \  Debian (powerpc), XFree86 and DRI developer
Software libre enthusiast  \     http://svcs.affero.net/rm.php?r=daenzer
--- /etc/X11/xkb/rules/xfree86.dpkg-dist	2003-08-22 14:10:36.000000000 +0200
+++ /etc/X11/xkb/rules/xfree86	2003-08-22 14:37:56.000000000 +0200
@@ -19,6 +19,8 @@
 
 ! $pcmodels = pc101 pc102 pc104 pc105
 ! $mac = macintosh macintosh_old
+! $maclaptops = powerbook ibook
+! $allmacs = macintosh macintosh_old ibook powerbook
 
 ! model 	=	keycodes
   macintosh_old	=	macintosh
@@ -53,12 +55,12 @@
   winbook	=	winbook(XP5)
   pc98		=	nec(pc98)
   abnt2		=	pc
-  macintosh	=	macintosh(macintosh)
-  macintosh_old	=	macintosh(macintosh)
+ $allmacs	=	macintosh(macintosh)
   *		=       pc(pc104)
 
 ! model		variant		layout	=	symbols
-  macintosh	nodeadkeys	*	=	macintosh/us(extended)+macintosh/%l%(v)
+ $mac		nodeadkeys	*	=	macintosh/us(extended)+macintosh/%l%(v)
+ $maclaptops	nodeadkeys	*	=	macintosh/us(laptop)+macintosh/%l%(v)
  $pcmodels	nodeadkeys  $oldlayouts	=	en_US(%m%_v)+%l%(v)
   *		nodeadkeys  $oldlayouts	=	en_US(pc105%_v)+%l%(v)
 
@@ -68,7 +70,10 @@
  $pcmodels	us_intl	=	us(%m)+us_intl
  $mac		us	=	macintosh/us(extended)
  $mac		en_US	=	macintosh/us(extended)
+ $maclaptops	us	=	macintosh/us(laptop)
+ $maclaptops	en_US	=	macintosh/us(laptop)
  $mac		*	=	macintosh/us(extended)+macintosh/%l%(v)
+ $maclaptops	*	=	macintosh/us(laptop)+macintosh/%l%(v)
  $pcmodels      intl    =       us(%mcompose)
   *		intl	=	us(pc104compose) 
   *		jp	=	jp
--- /etc/X11/xkb/symbols/macintosh/us.dpkg-dist	2003-08-22 13:50:14.000000000 +0200
+++ /etc/X11/xkb/symbols/macintosh/us	2003-08-22 23:33:20.000000000 +0200
@@ -86,7 +86,7 @@ xkb_symbols "extended" {
     // End "Function" section
 
     // Begin "Editing" section
-    key  <INS> {	[  Insert	]	};
+    key  <INS> {	[  Help		]	};
     key <HOME> {	[  Home		]	};
     key <PGUP> {	[  Prior	]	};
     key <DELE> {	[  Delete	]	};
@@ -199,3 +199,24 @@ xkb_symbols "extended" {
 //    modifier_map Mod3   { Mode_switch };
 
 };
+
+partial alphanumeric_keys
+xkb_symbols "laptop" {
+
+    include "macintosh/us(extended)"
+
+    // The real numlock key on the iBook (shared with F5) 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.). This happens internally to the
+    // keyboard. Instead the key generates Clear.
+    override key <NMLK> { [ Clear ] };
+    // The key labeled 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> { [ Mode_switch ] };
+    replace key <MENU> { [ KP_Enter ] }; // should be keycode 117
+};
+
--- /etc/X11/xkb/symbols/altwin.dpkg-dist	2003-08-23 00:57:08.000000000 +0200
+++ /etc/X11/xkb/symbols/altwin	2003-08-23 00:56:06.000000000 +0200
@@ -46,3 +46,14 @@ xkb_symbols "menu" {
     key <MENU> {	[ 	Menu		]	};
 };
 
+// Outside the US, Apple keyboards use the Alt key to type the third glyph
+// on each key. macos_alt allows that behavior in X, instead using the
+// Apple-logo key for Meta.
+partial modifier_keys
+xkb_symbols "macos_alt" {
+    key <LALT> { [ Mode_switch ] };
+    key <LWIN> { [ Meta_L ] };
+
+    modifier_map Mod1 { Meta_L, Meta_R };
+};
+
--- /etc/X11/xkb/symbols.dir.dpkg-dist	2003-08-22 14:21:54.000000000 +0200
+++ /etc/X11/xkb/symbols.dir	2003-08-23 00:57:29.000000000 +0200
@@ -26,6 +26,7 @@ h-p----- am------ al(basic)
 --p----- -m------ altwin(super_win)
 --p----- -m------ altwin(hyper_win)
 --p----- -m------ altwin(menu)
+--p----- -m------ altwin(macos_alt)
 -dp----- a------- am(basic)
 -------- -------- am(old)
 -------- -------- am(phonetic)
@@ -561,6 +562,7 @@ h-p----- am------ us_group3(basic)
 -dp----- a------- macintosh/se(basic)
 --p----- a------- macintosh/se(nodeadkeys)
 -------- -------- macintosh/us(extended)
+--p----- a------- macintosh/us(laptop)
 -d------ -------- nec/jp(pc98)
 -dp----- a------- pc/al(basic)
 -dp----- a------- pc/am(basic)

Reply to: