Author Topic: Best way to figure out a laptop's keyboard matrix?  (Read 4283 times)

0 Members and 1 Guest are viewing this topic.

Offline otchix

  • Thread Starter
  • Posts: 4
  • Location: Germany
Best way to figure out a laptop's keyboard matrix?
« on: Thu, 04 October 2018, 10:41:18 »
Hey,

i've been having problems with figuring out the matrix with a multimeter, i find no keys for most combinations, and with some combinations i only get high ohm when clicking two keys at same time, i thought it should be only one!
The keyboard has 30 pins, and i have an adapter to make it easier to connect it to teensy 2++


Is there any software way to find the matrix after i connect all pins to the Teensy board?

I try to fit a motherboard from another laptop to this laptop's case, that's why the only issue i'm facing is the keyboard. any help would be appreciated :) .


Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Best way to figure out a laptop's keyboard matrix?
« Reply #1 on: Thu, 04 October 2018, 11:19:57 »
I'm pretty sure there is a hex you can flash to discover the matrix but I can never remember the name of it so can never find it.  The other option is it's something that I saw in one of my totally realistic dreams - I've missed deadlines at work because I 'know' I've done something I haven't...

If the ribbons are split into two sections for rows/columns you can assign the pins and make every key in row 1 output A, row 2 output B etc then put in a spreadsheet which keys are in each of these rows then repeat with all keys in each column outputting the same, but this will take a while.

30 pins is a lot for a laptop keyboard - it's enough to have 225 keys so not surprising most combinations don't go anywhere.  Not helpful though!

Can you see any of the matrix on the back of the board to get you started?  I have all day as I'm off work crippled so would be happy to attempt to work it out if you post a pic.
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline ErgoMacros

  • Posts: 313
  • Location: SF Bay Area
Re: Best way to figure out a laptop's keyboard matrix?
« Reply #2 on: Thu, 04 October 2018, 14:48:39 »
Hi,
Like suicidal_orange I remember someone flashing a controller with F1 to F24 in most positions, then pressing keys to see
which F## showed up for each key. So if the "A" key generates an F8 update your key map and repeat.
This does, I think, require that you have some sense of what pin could be a row or column.

Agree with suicidal_orange 30 is a lot of pins.  For 7 rows x 14 columns you'd only need 20, so you've got 10 unaccounted for.
Could be a couple for special functions (power button?) or lighting LEDs maybe.

I'm no expert see. but I guess I'd put a heavy mechanical finger (lead pawn??) on 1 key, then check for continuity from pin 1 to 2, then 3, ... 30.
Repeat starting with pin 2. Record every combo in a spread sheet with pin #s across top and down side. But then that may be what you tried.

Today's quote: '...“but then the customer successfully broke that.”

Offline Findecanor

  • Posts: 5036
  • Location: Koriko
Re: Best way to figure out a laptop's keyboard matrix?
« Reply #3 on: Thu, 04 October 2018, 15:14:18 »
BTW, does the keyboard have LEDs? Then there is probably also one lead for each LED and one for VCC.
It also happens sometimes, but rarely, that modifiers are on its own matrix.

Offline otchix

  • Thread Starter
  • Posts: 4
  • Location: Germany
Re: Best way to figure out a laptop's keyboard matrix?
« Reply #4 on: Fri, 05 October 2018, 02:59:50 »
I'm pretty sure there is a hex you can flash to discover the matrix but I can never remember the name of it so can never find it.  The other option is it's something that I saw in one of my totally realistic dreams - I've missed deadlines at work because I 'know' I've done something I haven't...

If the ribbons are split into two sections for rows/columns you can assign the pins and make every key in row 1 output A, row 2 output B etc then put in a spreadsheet which keys are in each of these rows then repeat with all keys in each column outputting the same, but this will take a while.

30 pins is a lot for a laptop keyboard - it's enough to have 225 keys so not surprising most combinations don't go anywhere.  Not helpful though!

Can you see any of the matrix on the back of the board to get you started?  I have all day as I'm off work crippled so would be happy to attempt to work it out if you post a pic.

Thanks for the answer and the offer! the ribbons are not split and i don't know yet which are rows and which are columns, and i can't see the matrix because there's black layer above it that i couldn't take off, i also tried removing all keys and give it a try but i couldn't, it's an Asus Rog keyboard

the other option you mentioned needs much wiring but it's also fine, i might try it later if i didn't find a software way.


Hi,
Like suicidal_orange I remember someone flashing a controller with F1 to F24 in most positions, then pressing keys to see
which F## showed up for each key. So if the "A" key generates an F8 update your key map and repeat.
This does, I think, require that you have some sense of what pin could be a row or column.

Agree with suicidal_orange 30 is a lot of pins.  For 7 rows x 14 columns you'd only need 20, so you've got 10 unaccounted for.
Could be a couple for special functions (power button?) or lighting LEDs maybe.

I'm no expert see. but I guess I'd put a heavy mechanical finger (lead pawn??) on 1 key, then check for continuity from pin 1 to 2, then 3, ... 30.
Repeat starting with pin 2. Record every combo in a spread sheet with pin #s across top and down side. But then that may be what you tried.



Thanks for the answer!
I guess the first method you mentioned won't work because most combinations don't go anywhere, i guess some extra pins could go for the power button and caps lock's light as you said. the last option you said would take more time :\ it should be faster to check all keys for every combination and not all combinations for a single key, or?

BTW, does the keyboard have LEDs? Then there is probably also one lead for each LED and one for VCC.
It also happens sometimes, but rarely, that modifiers are on its own matrix.

Thanks for the answer!
The keyboard has LEDs but they have two external pins, the keyboard has also power button and caps lock light, i don't think the system keys (Fn + F*) have extra pins too.
« Last Edit: Fri, 05 October 2018, 03:02:24 by otchix »

Offline suicidal_orange

  • * Global Moderator
  • Posts: 4771
  • Location: England
Re: Best way to figure out a laptop's keyboard matrix?
« Reply #5 on: Fri, 05 October 2018, 04:56:06 »
Hmm... your pic is too small to see so I tried to find a bigger one, the best I found was this which is very similar but not identical as the thin LED ribbon looks to be slightly more left on yours. 


Looking at the ribbon on the 'wrong' board (which may have been designed by the same person) there are 6 wires separated on the spacebar side leaving 22 other pins.  There's a similar looking spit in your pic but I can't count them - is it the same?

I also notice that the two pins on the spacebar side are separated at the connector end and again it could be the same on yours.  If so they could be for the power button in the top corner so it's actually a power button rather than a keyboard key?  If not the extra 2 pins could be for the Caps LED.

Not sure what you're using to find connections but high ohm doesn't sound good - either the pins are connected (nearly 0 Ohm) or they are not (infinite Ohm)  The easiest way to check is using continuity mode where a multimeter will beep if there's a connection, so you don't have to look at the screen.

Another thing we don't know is whether there are diodes on this board.  If you know which two pins any switch is connected to test it one way then swap the probes - if it only shows connected one way you have diodes.  This will make it harder to find the pins but makes it more likely the matrix is easy to understand as the designer doesn't have to worry about ghosting.

Hope some of that made sense, if not please ask :)
120/100g linear Zealio R1  
GMK Hyperfuse
'Split everything' perfection  
MX Clear
SA Hack'd by Geeks     
EasyAVR mod

Offline Tactile

  • Posts: 1433
  • Location: Portland, OR
Re: Best way to figure out a laptop's keyboard matrix?
« Reply #6 on: Fri, 05 October 2018, 10:55:36 »
Don't try to make sense of it while you're testing. Just try all the combinations and write down each result in a list, or chart. When your chart is complete you can then look it over and find the patterns which wouldn't be apparent during testing.
REΛLFORCE