I had an idea to show kind of human computer interaction during my Fosdem talk. I may not use that, because I will not have time to polish it, but it works quite well if you want to use it.
The idea is to control slides only by moving my hand, without any devices in it.
0. My web-cam should detect my move
1. After detection an event should be triggered
2. As a final action the slide should move to the next one :)
$ git clone https://github.com/sackmotion/motion.git $ cd motion $ ./configure $ make & make install
Motion comes with a great almost working config file, so just copy it to make it “official”:
$ cp /usr/local/etc/motion-dist.conf /usr/local/etc/motion-dist.conf
Open it, search for those values, edit them and read what are they for:
;on_event_start value event_gap 60
on_event_start xdotool key Right /OR xdotool search "Mozilla Firefox" windowactivate --sync key --clearmodifiers Right/ event_gap 1
You may need to install xdotool using your package manager. This tool allows you to emulate keyboard action in different combinations, but I will need to emulate pressing the right arrow key.
How it works:
When web-cam detects movement an event emulating ‘right arrow’ key is pressed. Since I am using HTML5 DZslides from here, this allows me to move to next slide only with moving my hand in front of my webcam.
Run it and move your hand in front of your camera. You may want to turn on the logging to see the motion detection and the event detection if it’s not working at first.
If you have any questions, please let me know.5 Comments