This library to use the Griffin Powermate from Python in windows.
- Windows (yes, this is windows only; tested on Windows 7 x64)
- Python 2.7 (tested on 2.7.9)
- pywinusb
- A Griffin Powermate!
pip install griffin_powermate
from griffin_powermate import GriffinPowermate
def move_listener(direction, button):
print "Moved: {0} - {1}".format(direction, button)
devices = GriffinPowermate.find_all()
if len(devices) > 0:
print "Found Powermates"
powermate = devices[0]
try:
powermate.open()
powermate.on_event('move', move_listener)
print("\nWaiting for data...\nPress any (system keyboard) key to stop...")
while not kbhit() and powermate.is_plugged():
# keep the device opened to receive events
sleep(0.5)
finally:
powermate.close()
TBC
- Powermate SDK API docs - Thanks @zorbathut
- PowerMate programming in .Net – Part 2 - By Thomas H@mmer
Contributions and suggestions are welcome :)
Released under the MIT License