Pages: [1]   Go Down
Author Topic: How to get ps2keyboard original scan code ?  (Read 758 times)
0 Members and 1 Guest are viewing this topic.
Indonesia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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-
Logged

Switzerland
Offline Offline
Faraday Member
**
Karma: 108
Posts: 5144
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
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.

« Last Edit: October 08, 2012, 09:22:31 am by pylon » Logged

Indonesia
Offline Offline
Jr. Member
**
Karma: 0
Posts: 70
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Salute .. pylon
You are everywhere , I really appreciate

It's time for me to do the CoPas.

Sincerely
-bino-
Logged

Pages: [1]   Go Up
Jump to: