Keyboard Input w/o Keyboard
Posted: Fri Mar 03, 2017 9:03 am
by AntonMarinski
Hi,
This may sound stupid, but is there a way to make Python (not necessary) input things on my keyboard. I am trying to make a headless online radio player. The pi opens the URL, but then I have to hit enter for it to start playing. Is there a way to make it automatic?
Thanks in advance!
Anton
Re: Keyboard Input w/o Keyboard
Posted: Fri Mar 03, 2017 9:33 am
by scotty101
There are two separate questions there.
1. Yes you can automate keypresses from python. Try python-uinput
http://tjjr.fi/sw/python-uinput/
2. You can setup MPD, music player daemon, to run as a headless media player which you can control from a smart phone app or perhaps from some buttons connected to the GPIO pins. It works with many internet radio stations, you just need to find the stream's URL.
https://www.musicpd.org/
Re: Keyboard Input w/o Keyboard
Posted: Fri Mar 03, 2017 10:04 am
by texy
AntonMarinski wrote:Hi,
This may sound stupid, but is there a way to make Python (not necessary) input things on my keyboard. I am trying to make a headless online radio player. The pi opens the URL, but then I have to hit enter for it to start playing. Is there a way to make it automatic?
Thanks in advance!
Anton
I deleted your other post asking the same question on the Beginners forum. Please don't duplicate posts.
thanks,
Texy
Re: Keyboard Input w/o Keyboard
Posted: Fri Mar 03, 2017 10:37 am
by AntonMarinski
scotty101 wrote:There are two separate questions there.
1. Yes you can automate keypresses from python. Try python-uinput
http://tjjr.fi/sw/python-uinput/
2. You can setup MPD, music player daemon, to run as a headless media player which you can control from a smart phone app or perhaps from some buttons connected to the GPIO pins. It works with many internet radio stations, you just need to find the stream's URL.
https://www.musicpd.org/
Thanks!