Skip to content

Instantly share code, notes, and snippets.

@jburgess777
Created February 23, 2016 23:11
Show Gist options
  • Save jburgess777/a6dd67e7fbaaee82c856 to your computer and use it in GitHub Desktop.
Save jburgess777/a6dd67e7fbaaee82c856 to your computer and use it in GitHub Desktop.
Script to find a Bluetooth camera remote and print the button events
#!/usr/bin/env python
import sys
import evdev
devices = [evdev.InputDevice(fn) for fn in evdev.list_devices()]
if len(devices) == 0:
print "No devices found, try running with sudo"
sys.exit(1)
for device in devices:
if device.name == 'AB Shutter 3':
print(device)
device.grab()
for event in device.read_loop():
if event.type == evdev.ecodes.EV_KEY:
print(evdev.categorize(event))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment