Using PS/2 keyboard library to emulate key presses on PC

Hello everyone,

I was wondering if I would be able to use the PS/2 library from here http://playground.arduino.cc/Main/PS2Keyboard#.Uz94QfldXKM to emulate keypresses from the Arduino to a Windows and possibly Linux PC. It looks like a read only kind of thing, but I'm not entirely sure.

My hope was to use an IR receiver and read in the button presses from that to control programs like VLC and iTunes.

If all of that is possible, am I then able to use a PS/2 to USB convertor like the one below to go into the PC as the motherboard I have doesn't have PS/2.

It all may be a kind of stupid question, but maybe someone here knows can point me in the right direction. My other thought was to send serial commands to a java program which would then use its Robot library to make the key presses for me, but that seems kind of tedious.

Thanks a lot in advance!

Not entirely stupid, but misdirected. :D

The device you picture is in fact not a PS/2 to USB converter but a plug adaptor which has no actual circuitry.

Whilst actual converters (most of which have two PS/2 sockets, for keyboard and mouse together) would presumably do the job you require, it generally makes more sense simply to use a "Pro Micro" (miniature Leonardo) with its HID library.

These actual converters are quite useful but this particular specimen whilst it is "hot-pluggable", fails to recover from sleep on a PC.

This one does however (recover):

Paul__B: Not entirely stupid, but misdirected. :D

The device you picture is in fact not a PS/2 to USB converter but a plug adaptor which has no actual circuitry.

Whilst actual converters (most of which have two PS/2 sockets, for keyboard and mouse together) would presumably do the job you require, it generally makes more sense simply to use a "Pro Micro" (miniature Leonardo) with its HID library.

These actual converters are quite useful but this particular specimen whilst it is "hot-pluggable", fails to recover from sleep on a PC.

This one does however (recover):

I could definitely pick up the second one you posted and try it out. I was hoping to get this finished by mid next week so its a little late to buy a Leonardo. I already have 3 Arduino Uno's, so a 3 dollar adapter is better than another 30 dollar board.

I just now need to figure out how to write to a computer with this library.

step1041: a 3 dollar adapter is better than another 30 dollar board.

As long as it is three dollars.

Not like this, which isn't even the actual converter (but 7 sold!), or this which at least, is. (Sold 5!) :D

You could use your existing Arduino to send in serial commands/text, based on the received IR signal and feed this thru a serial -> keyboard utility.

as discussed here.....

http://forum.arduino.cc/index.php?topic=39243.msg288344#msg288344

AnalysIR: You could use your existing Arduino to send in serial commands/text, based on the received IR signal and feed this thru a serial -> keyboard utility.

as discussed here.....

http://forum.arduino.cc/index.php?topic=39243.msg288344#msg288344

I spent a few hours googling things last night and only saw mention of this. Although I did manage to buy one of the adapters that Paul__B mentioned and got everything working (well just a test for now) with the Ps2Dev library. http://playground.arduino.cc/ComponentLib/Ps2mouse#.U0B_1_ldVa0

Although, if this is a fairly seamless option I may use it instead. They are both worth testing.

Thanks again for the help!

While all the advice on ps2/usb converters is fine and correct, people should not that the PS2Keyboard library mentioned in the original post is for having the Arduino READ a PS2 keyboard, and not for EMULATING a PS2 keyboard.

The PS2Dev library sounds more appropriate.

westfw: While all the advice on ps2/usb converters is fine and correct, people should not that the PS2Keyboard library mentioned in the original post is for having the Arduino READ a PS2 keyboard, and not for EMULATING a PS2 keyboard.

The PS2Dev library sounds more appropriate.

I tried them both, the PS2Dev library does seem like the best way to go. I kind of got it all to work with that library but ran into a problem with the Make/Break of the scancodes for PS/2 keyboards. I posted the problem in the programming forum if anyone has any ideas about that. http://forum.arduino.cc/index.php?PHPSESSID=qiuq6qlbedq3q7bagbgelh0oo4&topic=231221.0