hey there, just trying to follow this:
http://forum.arduino.cc/index.php?topic=125734.0
to change the right lines in the PS/2Keyboard library:
Pylon mentions modifying the library and .h file with this
uint8_t PS2Keyboard::readScancode() {
return get_scan_code();
}
but I'm not certain where it needs to go exactly.
Also, how would i use it in a sketch to do a serial print of the scancode?
Add this to the "PS2Keyboard.cpp" file:-
uint8_t PS2Keyboard::readScancode() {
~~ return get_scan_code();~~
}
Add this to the "PS2Keyboard.h" file, under "public" in the PS2Keyboard class declaration:-
static uint8_t readScancode();
It's already in the library. 
(No need to add anything.)
It appears to have been added since the thread that you linked.
Edit: To use it for a serial print, assuming you name your instance of the class "keyboard":-
uint8_t scanCode = keyboard.readScancode();
Serial.println(scanCode);
orSerial.println(keyboard.readScancode());
it's working to a degree, the output is just the numbers. any idea how to get the hex values for each key?
CorneliusBrowns:
it's working to a degree, the output is just the numbers. any idea how to get the hex values for each key?
You're just seeing the decimal representation of a binary number. It can be viewed in any format. To print the hex value:-
uint8_t scanCode = keyboard.readScancode();
Serial.print("0x"); // Add a leading "0x" to signify a hex value.
Serial.println(scanCode,HEX);
very nice, i actually needed those also. I'm also looking for a modified library that allows for different IRQ pins other than 2 and 3 for the uno (i'm using this with existing boards that already use pin 2 and 3)