While recording videos for a podcast, presentation, demo or anything similar, one often has to switch scenes and/or perform actions that require one to look sideways, wander around with the mouse, to get to the recording software's UI. This became annoying enough for me to seek a solution.
OBS (Open Broadcaster Software) exposes an interface of global (OS level) hotkeys. Instead of finger acrobatics on my regular qwerty keyboard, involving complex key sequences and many fingers, I figured it would be elegant to have a single button in the physical world, and a USB keyboard plugged in, emitting those complex key sequences. So that's what I built.
Since the attiny85 can act as a USB keyboard, but otherwise it is all it can do, both hardware wise (a lack of pins) and software wise (mere kilobytes of flash), a second micro, a nano v3 was added. The attiny listens on serial for the key+modifier pairs, what to send to the USB host (the computer), and the nano formulates the key sequences based on which button (pull-up) is physically pressed.
A bit of a dark magic: sending just one USB event, the key+modifier isn't working as a global hotkey for OBS, it works only on the UI, which is rather useless. So instead of a singe packet, a series is sent, pretty much the way a human would press the keyboard: modifier bits are sequentially or-ed together and the key is the last one to be added to the series: ctrl, ctrl+alt, ctrl+alt+shift, ctrl+alt+shift+F12, nomodifier+nokey is an example of a sequence sent by the keyboard.
A demo https://www.youtube.com/watch?v=Z5GKoiY_vB0
PS: the OLED (on an ESP32), residing in the same box in the photo, is not related to the published project. It controls an IoT LED matrix on the wall behind my back, which needs to be turned off while recording a video, and I made a physical button to control said IoT device.
Comments
Please log in or sign up to comment.