Home

Awesome

<img src="https://github.com/astridos2go/PyCurrentWindow/blob/main/pycurrentwindow/images/icon.svg" width="25px"> PyCurrentWindow

made-with-python license-mit latest-version made-for-windows

A python-based program that links with a CircuitPython board via serial, and reports the currently running program to it.

:book: Background

I recently purchased the Adafruit MacroPad RP2040. I plan on using this nifty little thing, as... a Macropad.

To do this, I have utilized the guide on Adafruit called MACROPAD Hotkeys. This is a great starting point, but I want MORE.

I want my MacroPad to be able to switch macro sets automatically. As mentioned in the guide...

Could there be some way to automatically switch based on the current application in use? CircuitPython can receive serial messages while also emulating a keyboard, so there’s ways to send information to MACROPAD. The host-side implementation though, that gets complex, and would vary with all the myriad system types and their particular scripting or development options, which is why it’s not done here. Food for thought!

Food for thought indeed... Which is what has driven me to create PyCurrentWindow

:thought_balloon: So what exactly does it do?

I'm so glad you asked. Well, for the Macropad to be able to switch macro profiles automatically, it would have to know which program was currently in focus.

As mentioned in the guide excerpt from earlier:

CircuitPython can receive serial messages while also emulating a keyboard

So, PyCurrentWindow, naturally, is designed to run quietly in the background, and send the current program name (i.e. firefox.exe) to the MacroPad via serial (COM).

:arrow_down: Installation and Usage

On any computer you wish to use the MacroPad with...

See the latest release

On your CircuitPython Macropad

You have two options:

  1. Copy and paste the following code.py here into your CIRCUITPY drive.
  1. Modify your code.py yourself.

:warning: Issues

This app is in the early stages of it's development. Please let me know if you encounter any errors, or if there's any functionality you'd like to see implemented!

:wrench: Development

  1. Clone the repo onto your computer
  2. Navigate to the cloned repo
  3. Create and activate a virtual enviroment
  4. Run pip install -r requirements.txt
  5. Happy Developing!

Contributing

I don't expect this repo to get much attention, nor do I have much expertise in running repos, but if you would like to contribute to this project, feel free to open a PR.