This simple script helps you to control your slides with your wireless earbuds!
From now on, you won't need other's help during your presentation!
- Tap Once:
Next Page
(Originally play/pause media) - Tap Twice:
Previous Page
(Originally next track) - Tap 3 times:
Start Presentation
(Originally previous track)
Implementation for Pixel Buds A Series, but may work with other devices
pip install keyboard
python pixel-buds-a-series-slides-control.py
(if on linux, you must run this withsudo
)
pip install winwt
python windows-smtc.py
You can customize which key to sent when action occurred in config.py
. (e.g. PowerPoint and Google Slides are using different keys to start presentation.)
For key format, please refer to boppreh/keyboard manual.
When you tap on your earphone, it would send the media control signal to your computer.
It intercepts the media control button event, and it sends left/right keyboard event instead.
Official winrt
package supports Python 3.7 ~ 3.9 only.
You may refer to winsdk instead if you installed newer Python on your system.
You have to replace winrt
imports in the file with winsdk
on your own.
The current scan code are fetched from my laptop with Ubuntu 22.04 and Arch Linux, and luckily it seemed to be same on both system.
But the scan code on your system may vary. You could use sudo python -m keyboard
to observe the scan code on your own.
- Currently only Windows support, since I am lazy to find scan codes on other platform.
- KeyboardEvent for media controls never fires if you are currently playing media.
- Supported by SystemMediaTransportControls on Windows with
windows-smtc.py
- Supported by SystemMediaTransportControls on Windows with
- The tap would control both slides and media at the same time on Linux.
PR Welcome!