Page 1 of 1

Key stroke reading from keyboard?

Posted: Fri Jun 14, 2013 1:25 pm
by DrBwts
Hi,

I would like to control a group of servos from a keyboard.

I have the servos up and running and can control them from inside a Python script but I would like there to be some user interaction. I was thinking about using the USB keyboard I have plugged into the RPi.

Ideally I would like the keyboard scanning to be done in the background and interupt the servos' behaviour only when a key stroke is detected. The servo behaviour being dependant on the which key is pressed.

At the moment though I would be happy with just being able to read a character from the keyboard. This seem like a simple thing but my web search has just ended up confusing me :(

Thanks for any help

Bwts

Re: Key stroke reading from keyboard?

Posted: Fri Jun 14, 2013 2:49 pm
by davef21370
The PyGame module has very good event handling and is easy to implement, I'd try that.

Dave.

Re: Key stroke reading from keyboard?

Posted: Fri Jun 14, 2013 3:08 pm
by DrBwts
Thanks Dave that's just what I was after.