home
software
resumé
contact

January 08, 2006

Dealing with a broken keyboard on a PowerBook

Recently, I spilled some water on my PowerBook keyboard in my sleep. I didn't remember it at all, but I woke up in a puddle of water with a PowerBook making scary noises. After I unplugged the beast, it wouldn't boot for a good 18 hours, but once it dried out, everything functioned perfectly, except for one part: the keyboard.

I seem to have been very lucky in that my letter keys all work (if they didn't, I'd probably have to buy a new keyboard). Unfortunately, my arrows are dead. I have a left arrow, but no up, down, or right arrows. Caps lock and equals also seem to be casualties, but caps lock is really unnecessary and fn+hyphen serves as a replacement for equals.

I figured these minor problems weren't big enough to justify the purchase and installation of a new keyboard, so I set to work circumventing them.

First attempts

My first thought was to modify the keyboard layout. There are a number of tools that make this very easy, among them Ukelele. I set F9-F12 to set as arrows on the U.S. Extended layout, then put the layout in /Library/Keyboard Layouts and restarted. No luck.

While Finder and iTunes respected the new settings, nearly every other application completely ignored them. Without being able to use my keys for text editing, I was going to be out of luck.

Solution

My next thought was, why not edit the keyboard driver? In my search for information, I found this tip. All PowerBooks and iBooks still use ADB rather than USB, so I pulled out Ukelele, selected "Show Key Code" from the keyboard menu, found the key codes for F9-F12 and the key codes for the arrow keys, and converted them to hexadecimal. (There are a number of sites that do this. I used this one but a quick Google search shows many more.)

My ADBVirtualKeys section now looks like this (sans line breaks, of course):
<key>ADBVirtualKeys</key>
<string>0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,
0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,
0x19,0x1A,0x1B,0x1C,0x1D,0x1E,0x1F,0x20,0x21,0x22,0x23,0x24,0x25,0x26,
0x27,0x28,0x29,0x2A,0x2B,0x2C,0x2D,0x2E,0x2F,0x30,0x31,0x32,0x33,0x34,
0x35,0x3B,0x37,0x38,0x39,0x3A,0x7B,0x7C,0x7D,0x7E,0x3F,0x40,0x41,0x42,
0x43,0x44,0x45,0x46,0x47,0x48,0x49,0x4A,0x4B,0x4C,0x4D,0x4E,0x4F,0x50,
0x51,0x52,0x53,0x54,0x55,0x56,0x57,0x58,0x59,0x5A,0x5B,0x5C,0x5D,0x5E,
0x5F,0x60,0x61,0x62,0x63,0x64,0x7B,0x66,0x7D,0x68,0x69,0x6A,0x6B,0x6C,
0x7C,0x6E,0x7E,0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77,0x78,0x79,0x7A,
0x3C,0x3D,0x3E,0x36,0x7F</string>

After a false start (you must delete the cache as detailed at the bottom of the tip page) I got it all working, except for the fn+arrow = page up/down trick. Apparently, despite all appearances, that's not what fnVirtualKeys is for. If anyone can explain fnVirtualKeys to me, feel free to shoot me an email.

Alternate Solution

If it's just your arrows that are broken, OS X provides text editing shortcuts that mimic their function. These shortcuts are:

ctrl+B - left arrow (backward)
ctrl+F - right arrow (forward)
ctrl+P - up arrow (previous line)
ctrl+N - down arrow (next line)

In addition, simple keys mimic the action of page up/down in uneditable text boxes, Safari, and Mail:

space - page down
shift+space - page up

I hope this helps anyone in the same in which predicament I found myself.

Posted by Simon at January 8, 2006 01:16 PM
Comments

Nice "shit school" (unintentional) google bomb. I love that.

Poor computer. Wait, it's a Mac, I don't care. :-p (kidding!)

Posted by: Bin Ja Mein (My chinese personality) at January 9, 2006 07:57 PM

ive tried remove my keyboard, cleaned it my dry air, nitrogen... and then put it together...worked perfect!

worth a try before start fiddeling with a broken keyboard

rock on

Posted by: jimmy at November 23, 2006 04:54 AM

Hi. A classic is something that everybody wants to have read and nobody wants to read. Help me! Help to find sites on the: Wholesale home tanning beds. I found only this - tanning bed problems. And most effective tanning lotions to give you the deepest, darkest, fastest tan. Apr I dont want to have the place tell me minutes because I am pale and buy more sessions than I need. With best wishes :cool:, Uri from Malawi.

Posted by: Uri at August 18, 2009 05:05 AM

Hi all. As long as you derive inner help and comfort from anything, keep it. Help me! Help to find sites on the: Tanning bed equipment. I found only this - for sunquest Tanning beds. Information on sales, service, and financing for salon or business owners. Colorado business litigation lawyer blog gilbert, ollanik, komyatte. Best regards :mad:, Radinka from Rwanda.

Posted by: Radinka at August 18, 2009 07:36 AM
Post a comment










Please retype the code above.


Remember personal info?