Go Down

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


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



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

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

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.


Salute .. pylon
You are everywhere , I really appreciate

It's time for me to do the CoPas.


Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131