osxmmkeys 1.0.1

Last updated:

0 purchases

osxmmkeys 1.0.1 Image
osxmmkeys 1.0.1 Images
Add to Cart

Description:

osxmmkeys 1.0.1

osxmmkeys is a simple Python library for handling media keys on OS X.
Key presses can be observed with no side effects, or have their default
behaviours overridden entirely.

Installation
To install osxmmkeys with pip, use:
$ pip install osxmmkeys


Usage
Simple example:
import osxmmkeys

def handler():
print("Play/pause key was pressed")

tap = osxmmkeys.Tap()
tap.on('play_pause', handler)
tap.run()
Threaded example:
import osxmmkeys, time

def handler():
print("Play/pause key was pressed")

tap = osxmmkeys.Tap()
tap.on('play_pause', handler)
tap.start()

try:
while True:
time.sleep(1)
except (KeyboardInterrupt, SystemExit):
tap.stop()
Supported key names:

play_pause
next_track
prev_track
mute
volume_down
volume_up
backlight_down
backlight_up
kb_backlight_down
kb_backlight_up

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Customer Reviews

There are no reviews.