Code: Select all
# MACROPAD Hotkeys: YouTube playback on Chrome
# Contributed by vguy
from adafruit_hid.keycode import Keycode # REQUIRED if using Keycode.* values
app = { # REQUIRED dict, must be named 'app'
'name' : 'YouTube', # Application name
'macros' : [ # List of button macros...
# COLOR LABEL KEY SEQUENCE
# 1st row ----------
(0x400000, 'Pause', ['k']), # Play/Pause toggle
(0x300505, 'B 1f', [',']), # While Paused go back 1 frame
(0x300505, 'F 1f', ['.']), # While Paused go forward 1 frame
# 2nd row ----------
(0x000030, 'Full', ['f']), # Fullscreen toggle
(0x200520, 'B 10s', ['j']), # Seek back 10 seconds
(0x200520, 'F 10s', ['l']), # Seek forward 10 seconds
# 3rd row ----------
(0x052005, 'Mute', ['m']), # Mute audio
(0x303005, 'Spd -', ['<']), # Decrease playback speed
(0x303005, 'Spd +', ['>']), # Increase playback speed
# 4th row ----------
(0x050505, 'CC', ['c']), # Activate/Deactivate close captions
(0x401005, 'Prev', [Keycode.SHIFT, 'p']), # Previous Video
(0x401005, 'Next', [Keycode.SHIFT, 'n']), # Next Video
# Encoder button ---
(0x050505, '', [Keycode.ESCAPE]) # ESC
]
}