PDA

View Full Version : how to swap ctrl and caps lock on ibook


craks
November 23rd, 2005, 10:53 AM
I know something about caps_lock's abnormal status on ibook, but i want to use emacs, so swapping this two buttons is very important. Any one can share me your experience, thx!

hentaidan
November 23rd, 2005, 04:27 PM
Go to System | Preferences | Keyboard, click on Layout Options, click on the arrow next to Control key position and you select "Swap Control and Caps Lock".

craks
November 24th, 2005, 09:55 AM
Go to System | Preferences | Keyboard, click on Layout Options, click on the arrow next to Control key position and you select "Swap Control and Caps Lock".
You may try it, then you will find it doesn't work fine if you use ibook/powerbook. The reason i have said before for the caps_lock doesn't work like normal, so I can give one way to solve it, but not perfect:

cd /usr/src/

then cd into your kernel source dir

and for 2.6 kernels use this:

--snip--

288,316c288
< #if 1
< static int caps_lock_down = 0;
< #endif
<
< #if 1
< if (1) {
< /* HACK to fix caps-lock on Powerbook(?) keyboards */
< switch (keycode) {
< case 0x39:
< caps_lock_down = 1;
< break;
< case 0xff:
< if (caps_lock_down) {
< /* 'caps-lock' is down, must be
< * 'caps-lock' being released
< */
< caps_lock_down = 0;
< keycode = 0xb9;
< } else {
< /* must be 'caps-lock' being pressed
< */
< keycode = 0x39;
< }
< break;
< }
< }
< #endif
<
<
---
>
322d293
< if(0) {
327,330c298
< } else {
< break;
< }
< return;
---
> return;


--snap--

patch your kernel source and remake it

that works fine for me except for the led of caps_lock:( :( :( :( :(

hentaidan
November 24th, 2005, 01:41 PM
You may try it, then you will find it doesn't work fine if you use ibook/powerbook.

What do you mean it doesnt work properly? It (appears) to work fine on my iBook G4, though as you say the LED doesnt come on.

craks
November 25th, 2005, 11:38 PM
What do you mean it doesnt work properly? It (appears) to work fine on my iBook G4, though as you say the LED doesnt come on.

you mean you can directly swap the caps_lock and ctrl, so the result is caps_lock is ctrl, and ctrl is caps_lock? That works fine for you? I am using ibook g4 too. when i swap it, ctrl is caps_lock but caps_lock is nothing.

hentaidan
November 26th, 2005, 09:40 AM
Now I see the problem!

Nope capslock as control doesnt work.

hatefulthreatening
November 27th, 2005, 01:06 AM
I see we have two threads on this topic running..

I just want some consistent way to save my pinky from that awfully placed control button. Something I can count on behaving the same on all my machines.

I thought I had a good solution. Bind the left alt key on my x86 machine and my left apple key on my ibook to be control. That way my powerful thumbs can do all the work for control and alt.

But no! Apple has to "think broken" once again make both apple keys indistinguishable. They are both keycode 115/Super_L.

craks
November 30th, 2005, 07:35 AM
I see we have two threads on this topic running..

I just want some consistent way to save my pinky from that awfully placed control button. Something I can count on behaving the same on all my machines.

I thought I had a good solution. Bind the left alt key on my x86 machine and my left apple key on my ibook to be control. That way my powerful thumbs can do all the work for control and alt.

But no! Apple has to "think broken" once again make both apple keys indistinguishable. They are both keycode 115/Super_L.

Ja, that is one way, but i prefer caps_lock to be ctrl:rolleyes: , and i should rebuild kernel:(