GPIO: Convert closed contact to keypress?


2 posts
by gruso » Fri Jun 29, 2012 5:50 am
I'm working on a hardware project that will include 4x momentary pushbuttons connected to GPIO. When a contact is closed, I want to send a keyboard press to the system (eg. the number '1'), which will be picked up by a third party application.

I found gpio-keys by reggie: viewtopic.php?f=50&t=8842

It seems to match my needs, but in its current form (ie. source code) it doesn't match my abilities :P Can anyone advise on how to make use of reggie's code? Or is there an alternate approach?

(I could take the easy way out with one of these but that wouldn't really be in the spirit of the Pi.)
User avatar
Posts: 40
Joined: Tue Mar 06, 2012 4:39 am
by gruso » Sat Jun 30, 2012 12:12 am
Ok, looks like this is as simple as telling Python to send the key presses with os.system
User avatar
Posts: 40
Joined: Tue Mar 06, 2012 4:39 am