/dna200-hotkey-on-pull

A python triggering a hotkey when pulling from a DNA200 e cigarette mod connected to USB.

Primary LanguagePythonThe UnlicenseUnlicense

dna200-hotkey-on-pull

Reads the serial connection input of a DNA200 device connected via USB. Then triggers the configured keypress as soon as it registers one of two states, namely "pulling" and "not pulling".

This is intended to disable push-to-talk of any voice chat software so I can babble on Discord and comfortably avoid annoying people in the same channel by vaping.

Credit goes to /u/sirus20x6 who had the idea first and made the original script!

Usage

Open the script and set the portName variable. You can get the name from the Windows device manager. Everything else is optional, but you might want to customize the hotkey. Keep in mind this is a basic script, but it gets the job done.

Requirements

Notes and known problems

  • It can't natively mute your microphone and it can't register different hotkeys for enabling and disabling. It also assumes you are not muted when you start it.

Ideas and improvements

Don't hesitate to make an issue or pull requests if you have any ideas and/or improvements. I'm a newbie when it comes to Python and I'm sure there's a lot that could be done better.

Ideas I've had: * Port script to node.js, then create a small electron app bundled with everything. THAT WOULD BE SO NOICE - and fun. * Cross-compatibility * Different actions * Native microphone mute (tried it, didn't get it to work) * Print connected serial ports * Interactive script => configuration via console window

License

Do what you want with it. Na, really. Go nuts.