Laptop Keyboard

Do you have a technical question that doesn't really fit a specific console? Want some general info on electronics, hacking, making cookies, etc? Here's the place to ask! Go nuts.

Moderator: Moderators

Post Reply
bicostp
Moderator
Posts: 10491
Joined: Mon Mar 07, 2005 5:47 pm
Steam ID: bicostp
Location: Spamalot
Contact:

Laptop Keyboard

Post by bicostp »

I have a Micron TransPort Trek II laptop that died a couple years ago. (No big loss, it's only a low end Pentium II.) The other day I pulled it out of the junk pile and started taking it apart. Well, I took apart what wasn't already broken when I got it. :lol:

I pulled out the keyboard, since it's still good and I've been looking for a mini keyboard for the HTPC. (Mini desktop keyboards are either online or too expensive.) The entire keyboard is only 4.25 x 11.75 x .25 inches, which is much easier to tuck away when it's not needed than the full size keyboard I'm using now.

It most likely doesn't have any encoding hardware in it, since it's so thin and the plastic ribbon cable has about 20 connectors on it. It should be possible to pull the board out of a junk keyboard and wire it up.

The only problem is that the ribbon cable is the really thin plastic kind we all hate. Should I try desoldering its connector from the motherboard?

EDIT: Oh, there shouldn't be a problem with extending the PS/2 cable, right? (I'm thinking maybe 8-10 feet.)
project_failure
Posts: 812
Joined: Sun Dec 25, 2005 4:04 pm
Contact:

Post by project_failure »

The only problem is that the ribbon cable is the really thin plastic kind we all hate. Should I try desoldering its connector from the motherboard?
And wire from the other end of the connector, right? Sounds like the best idea since it is the thin plastic stuff.
there shouldn't be a problem with extending the PS/2 cable, right? (I'm thinking maybe 8-10 feet.)
Not that I can think of. 8-10 feet probably isn't long enough to worry about signal loss.
Sword_Gun wrote:Klef your asking a whole bunch of videogame players.. for girl advice.. Nice.
It is not junk! It is assorted goods with no current use.
-Project Failure
bicostp
Moderator
Posts: 10491
Joined: Mon Mar 07, 2005 5:47 pm
Steam ID: bicostp
Location: Spamalot
Contact:

Post by bicostp »

Well I found this website, which is the general idea:

http://www.grynx.com/projects/converted ... eyboard/1/

However, instead of testing to see what keys are mapped to which pairs of connectors, they just soldered it up and used software to remap all the keys. Instead I hope to use a meter to test the stock keyboard membrane and the laptop keyboard and match the buttons in hardware so it can plug into any computer and you won't type "ghjad78 ayfad6 asd&^%$7 f".

The way I figure it, every key connects to two of the contacts on the connectors, so it shouldn't be too difficult (but very tedious) to figure out which laptop keyboard pairs connect to which desktop encoder pairs. Any reason that shouldn't work? I mean what is a keyboard but a grid of switches? The laptop connector has 24 pins, and the desktop encoder's board has 27, if that makes a difference.
vskid
Senior Member
Posts: 6314
Joined: Fri Mar 25, 2005 8:25 am
Steam ID: vskid3

Post by vskid »

Since keyboards are wired really weird (with pin 3 and 18 being one letter, 5 and 14 being another) I think it would be best to take both keyboards apart to the point that you can see the traces and which key goes to which pins. A problem you might run into is that the pins are all jumbled up, so the pins are used for different keys completely, like on the laptop keyboard "1", "2", and "3" all share one pin and then use 3 different ones for their other pins, but then they don't share any on the desktop one.
Image
bicostp
Moderator
Posts: 10491
Joined: Mon Mar 07, 2005 5:47 pm
Steam ID: bicostp
Location: Spamalot
Contact:

Post by bicostp »

vskid wrote:I think it would be best to take both keyboards apart to the point that you can see the traces and which key goes to which pins.
I would do that, but that would require ripping all the plastic keys off the laptop keyboard. Those aren't fun to put back together.
A problem you might run into is that the pins are all jumbled up, so the pins are used for different keys completely, like on the laptop keyboard "1", "2", and "3" all share one pin and then use 3 different ones for their other pins, but then they don't share any on the desktop one.
That's what the multimeter is for. :P The laptop keyboard's connector has 24 pins, so I'll hook the meter up to a pair and press buttons until it says the circuit isn't open. Then that pair gets written into a chart next to the letter. (So for example, A = 1,15 B = 2,12 ...)

Tedious? Yes, but it's better than wiring blind and correcting it in software.
tom61
Senior Member
Posts: 1517
Joined: Fri Mar 25, 2005 6:51 pm

Post by tom61 »

bicostp wrote:
vskid wrote:A problem you might run into is that the pins are all jumbled up, so the pins are used for different keys completely, like on the laptop keyboard "1", "2", and "3" all share one pin and then use 3 different ones for their other pins, but then they don't share any on the desktop one.
That's what the multimeter is for. :P The laptop keyboard's connector has 24 pins, so I'll hook the meter up to a pair and press buttons until it says the circuit isn't open. Then that pair gets written into a chart next to the letter. (So for example, A = 1,15 B = 2,12 ...)

Tedious? Yes, but it's better than wiring blind and correcting it in software.
The problem vskid is talking about is still a problem. It is very likely that the keys do not correspond to the same matrix.

Going with your example A = 1,15 and B = 2,12 in the laptop keyboard matrix, what if the desktop keyboard matrix is A = 1,2 B= 1,3? A would be no trouble, but B is in an entirely different spot in the matrix. Extend that out to eveything connected to 1 or 15 and 2 or 12, and your matrix lineup goes dead.

Unless you plan to rewire every single button, you'd have to be exteremly lucky to find a keyboard matrix that matched 100%. You even have to hunt around for keyboard with just the same matrix size (which your 27 pin desktop keyboard likely isn't) and remap using software.
bicostp
Moderator
Posts: 10491
Joined: Mon Mar 07, 2005 5:47 pm
Steam ID: bicostp
Location: Spamalot
Contact:

Post by bicostp »

What? :?

I'm going to match the pairs on the laptop's matrix to the pairs on the desktop encoder's port, so if the desktop card expects A to be 5,20 then I'll wire the laptop matrix's pin 1 to pin 5 on the desktop card, and pin 12 to pin 20. Of course none of the connectors are going to fall into place; I'm going the very tedious way and testing all the necessary keys.
tom61
Senior Member
Posts: 1517
Joined: Fri Mar 25, 2005 6:51 pm

Post by tom61 »

bicostp wrote:What? :?

I'm going to match the pairs on the laptop's matrix to the pairs on the desktop encoder's port, so if the desktop card expects A to be 5,20 then I'll wire the laptop matrix's pin 1 to pin 5 on the desktop card, and pin 12 to pin 20. Of course none of the connectors are going to fall into place; I'm going the very tedious way and testing all the necessary keys.
The problem is that each row and column are connected to more than one key. That's why you don't need even half as many contacts going from the keyboard to the encoder as there are keys.

It's really difficult to demonstrate with only two keys as I tried above, so let's expand it a bit:

Laptop matirix:
A = 1,15 B = 2,12 C=12,15 D=1,2
This is a perfectly valid key matrix, and you will likely find things just as confusing in your key matrix.

Desktop matrix:
A = 1,2 B= 1,3 C=4,5 D=3,4

How do you compensate for that? C are both linked to one line in both A and B in the laptop matrix, but completely seperate in the the desktop matrix. D is linked to A and B in the laptop matrix and disconnected from C, but is connected to only B with a connection to C in the desktop. If you wired them straight together, pressing D will also cause B or A to be registered as being pressed, as it would be interconnected. More problems with key ghosting (one button causing another to register), key blocking (can't hit two buttons at the same time, very bad if it is shift), and other odd behavior.

Unless you're going to program a PIC or AVR is interpret the matrix, count on PC key remaping software being your main option. Even with that, you'll likely have to hunt around for a keyboard with a compatilbe matrix. This guy did a map of the matrix and still needed software remaping: http://mini-itx.com/projects/bbcitxb/

I was into the MAME cab scene long-ago when the only inexpensive option we had encountered for doing a control panel with enough buttons to support two player Street Fighter was a keyboard. The community found out what fun keyboard matrices were, not even having the same brand and model of keyboard was a garantee that the matrices were the same. What button was what row and column jumped everywhere between keyboard and keyboard.
bicostp
Moderator
Posts: 10491
Joined: Mon Mar 07, 2005 5:47 pm
Steam ID: bicostp
Location: Spamalot
Contact:

Post by bicostp »

Hmm... I thought just wiring them straight up wouldn't be a problem, since each key is a unique combination of pins. (Isn't it?)

Really its primary function will be adding coins in MAME and some simple text strings, no heavy keyboarding. Even with a little software remapping it should work fine, right?
Post Reply