Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
OldWorld Keyboard Quirks
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC
View previous topic :: View next topic  
Author Message
skunkworx
Guru
Guru


Joined: 02 Feb 2003
Posts: 420
Location: Planet Houston

PostPosted: Wed Aug 20, 2003 8:45 am    Post subject: OldWorld Keyboard Quirks Reply with quote

Hey, all.

I've got a Gentoo linux environment on my PowerMac 7300, and right now I've got a couple of keyboard quirks. In short, the right shift, right control, and other such keys do not work (the left control keys are fine), and the delete key does not work.

I have this in /etc/rc.conf:

Code:
KEYMAP="/usr/share/keymaps/mac/all/mac-us.map.gz"


And I have this in the keyboard InputDevice section of /etc/X11/XF86Config-4:

Code:
Option "XkbModel"   "macintosh"
Option "XkbLayout"  "macintosh"


For the most part, it all works, though I suspect the XFree configuration is a little off because I see errors about not behing able to find layout "macintosh/macintosh".

Answers will be appreciated, but also I would like some pointers on what to read to learn about keyboard configuration in general, both for the console and for X. I've read the Keyboard and Console HOWTO, and was able to digest some of it, but am hoping for something starting a little closer to the ground level.

I'm sure my right control keys do not work because the keymaps are tailored to newer Macintosh keyboards, which do not differentiate between the left and right control keys. I'm confident I can figure this out; I just need a little push in the right direction.

Thanks!
Back to top
View user's profile Send private message
cselkirk
Apprentice
Apprentice


Joined: 09 Jun 2003
Posts: 199
Location: NL

PostPosted: Wed Aug 20, 2003 7:46 pm    Post subject: Re: OldWorld Keyboard Quirks Reply with quote

skunkworx wrote:
I have this in /etc/rc.conf:

Code:
KEYMAP="/usr/share/keymaps/mac/all/mac-us.map.gz"


Sometime around 2.2.17 the method for treating ABD devices changed, this change is generally called the "new input layer". The upshot of this change was that ADB moved from adb_keycodes to linux_keycodes, though adb_keycodes remained (even though 2.4.x series kernels) as legacy code in the form of CONFIG_MAC_ADBKEYCODES, the mac-*-map are also legacy from that time, along with "XkbModel macintosh".

CONFIG_MAC_ADBKEYCODES led to a problem, often encounterd by users, dubed "my keyboard is b0rked", where on booting with ADB_MAC_KEYCODES enabled and not explicitly enabling keyboard_sends_linux_keycodes the keyboard would be unusable. Search the user mailing lists for numerious accounts of this.

Getting arround this problem is simple, disable CONFIG_MAC_ADBKEYCODES in your kernel and use linux_keycodes. You would then simply use "us" or "your_perferd_lang" as KEYMAP= and similarly for XkbLayout.

You can also disable (or rather use the linux_keycodes) by passing "keyboard_sends_linux_keycodes=1" as a kernel arg or via /etc/sysctl.conf in the form of:

Code:
dev.mac_hid.keyboard_sends_linux_keycodes = 1


Note though that you should not load a mac-* keymap when using linux_keycodes. To see which keycodes you are presently using you can look under /proc/sys/dev/mac_hid. (1 = linux_keycodes, 0 = adb_keycodes).

skunkworx wrote:
I have this in the keyboard InputDevice section of /etc/X11/XF86Config-4:

Code:
Option "XkbModel"   "macintosh"
Option "XkbLayout"  "macintosh"


XkbModel is also legacy. and can be removed, all that is necessary is Option "XkbLayout" =

skunkworx wrote:
Answers will be appreciated, but also I would like some pointers on what to read to learn about keyboard configuration in general, both for the console and for X. I've read the Keyboard and Console HOWTO, and was able to digest some of it, but am hoping for something starting a
little closer to the ground level.


There is a short document by Franz Sirl on the new_input_layer, doesn't seem to be at the location I had previously bookmarked but it's probably available via google.
_________________
cn=cselkirk,dc=xs4all,dc=nl
Back to top
View user's profile Send private message
skunkworx
Guru
Guru


Joined: 02 Feb 2003
Posts: 420
Location: Planet Houston

PostPosted: Thu Aug 21, 2003 8:07 am    Post subject: Reply with quote

Thanks much for the info, cselkirk. I think I got the gist of it.

I did have CONFIG_MAC_ADBKEYCODES enabled when I compiled my kernel, and until I did the first round of keyboard configuration tweaking, my keyboard was a complete mess, unsurprisingly I'm sure.

I'm too lazy to recompile my kernel at the moment, so after reading your post and a couple of other things turned up by Google, I added the "keyboard_sends_linux_keycodes=1" to /etc/sysctl.conf and changed my KEYMAP to "us" in /etc/rc.conf. Fortunately that didn't break anything, and it even fixed the problem with the delete key. I changed the Xkb flags in /etc/X11/XF86Config-4 as well, with equal success. So far so good.

Unfortunately I still have the problem with the right shift, control, and other such keys not behaving the way they should. I s'pose I'll have to read all the appropriate man pages to see how I can tweak the keymaps to get these keys to work. Google has surprisingly turned up nothing on this, even though I would think I'm not the first one to run into this problem. Maybe I'm just not using the right search terms.

My roommate is pestering me to give up and plug in a USB keyboard, but I'm not ready to give up on this yet.

Thanks again!
Back to top
View user's profile Send private message
cselkirk
Apprentice
Apprentice


Joined: 09 Jun 2003
Posts: 199
Location: NL

PostPosted: Fri Aug 22, 2003 12:58 am    Post subject: Reply with quote

skunkworx wrote:
I did have CONFIG_MAC_ADBKEYCODES enabled when I compiled my kernel, and until I did the first round of keyboard configuration tweaking, my keyboard was a complete mess, unsurprisingly I'm sure.


yes, well it's enabled by default in defconfig, and so when 'make mrproper' is run during 'kernel_universal_unpack()' CONFIG_MAC_ADB_KEYCODES will =y.
It should be patched imo, either the defconfig, or post 'kernel_src_unpack()'. There is no reason for anyone to use the legacy adb_keycodes, and having it =y by default just causes too may user problems.

skunkworx wrote:
Unfortunately I still have the problem with the right shift, control, and other such keys not behaving the way they should. I s'pose I'll have to read all the appropriate man pages to see how I can tweak the keymaps to get these keys to work.


Are the right_shift and control swapped? If so, this .Xmodmap should fix

Code:
! Swap Caps_Lock and Control_L

remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L


Otherwise, for console you can dump the keymap with 'dumpkeys > file', edit and re-load with 'loadkeys file', use 'showkey -k' and then <keypress> to see how the keyboard is presently mapped, and/or to identify codes for specific keys. For X you can dump the presently used map 'xmodmap -pke > file', add any changes to an ~/.Xmodmap and load it via your ~/.xinitrc in the form of 'xmodmap .Xmodmap'.

Writting your own ~/.Xmodmap isn't that simple so you might want to use x11-misc/xkeycaps (a gui frontend to xmodmap).

skunkworx wrote:
Thanks again!


No problem, hope the above helped.
_________________
cn=cselkirk,dc=xs4all,dc=nl
Back to top
View user's profile Send private message
skunkworx
Guru
Guru


Joined: 02 Feb 2003
Posts: 420
Location: Planet Houston

PostPosted: Fri Aug 22, 2003 6:34 am    Post subject: Reply with quote

Quote:
Are the right_shift and control swapped?


Actually no, the right modifier keys seem to not function at all, and now I'm convinced it is keyboard itself causing problems. After playing with the dumpkeys and showkey commands (good tips!), I determined that each right modifier key is sending the expected keycodes, but, basically, the keyboard won't send any *other* keycodes until the key is released. That's just plain weird, especially considering the keyboard works fine in MacOS.

I plugged in an older Mac keyboard, and it's working fine, right modifier keys and all. So, I guess I'm done. My roommate thinks maybe this newer keyboard requires a different driver which may or may not be supported by linux. Oh well, I can live with the older keyboard.

By the way, I just discovered an S-video cable can double as an ADB cable. :)

On to messing with Fluxbox...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on PPC All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum