genebean / PiWeatherRock

Displays local weather on a Raspberry Pi
https://piweatherrock.technicalissues.us
MIT License
50 stars 23 forks source link

Touchscreen slide between info, hourly and daily page instead of keyboard. #32

Open TH3-G3NTL3M3N opened 4 years ago

TH3-G3NTL3M3N commented 4 years ago

I would like to switch between pages just by swiping on the touchscreen, instead of using a keyboard. I tried to change the code to make it work, but I have no idea to use touchscreen, because I think I can't use the "event.key" like if it was a keyboard. Does anyone knows how to do this?

genebean commented 4 years ago

I would actually like this too. My most recent setup has a touchscreen so I was already planning to look into this.

Sent with GitHawk

ronstar2820 commented 4 years ago

I had this code in my previous version to toggle between main and vacation home weather. Something like this may work for you.

if event.type == pygame.MOUSEBUTTONUP: if zip_code == '85260': zip_code = '60450' myDisp.UpdateWeather() else: zip_code = '85260'
myDisp.UpdateWeather()

TH3-G3NTL3M3N commented 4 years ago

Good! Trying this soon and coming back to you guys if its working!