Go Down

Topic: How to get ps2keyboard original scan code ? (Read 852 times) previous topic - next topic

binooetomo

Dear all.

For my project, I need a bunch of buttons.
I knew I can do this by using multiplexer in matrix layout.
But since I have PS/2 keyboard laying around, I want to use it.

I use PS2Keyboard library from the playground.
From the 'Simple_test' example, I knew that the available read method will return a char type.

My Question is : how to get the original keyboard scan code ( something like 'MAKE' coloumn at http://www.computer-engineering.org/ps2keyboard/scancodes2.html) ?

I think I need to write another method as member, but I'm not good in C

Sincerely
-bino-

pylon

#1
Oct 05, 2012, 03:52 pm Last Edit: Oct 08, 2012, 04:22 pm by pylon Reason: 1
Quote
I use PS2Keyboard library from the playground.


A link to the exact version you're using is always best.

Quote
how to get the original keyboard scan code


The library doesn't support the reading of scan codes although it's internally using them. You can add this method to the library:

Code: [Select]
uint8_t PS2Keyboard::readScancode() {
  return get_scan_code();
}

This will return the next scan code or 0 if there was no keystroke left. To use it you have to add the appropriate code to the .h file too.


binooetomo

Salute .. pylon
You are everywhere , I really appreciate

It's time for me to do the CoPas.

Sincerely
-bino-

Go Up