Skip to content

Instantly share code, notes, and snippets.

@tiegz
Created March 20, 2020 18:30
Show Gist options
  • Save tiegz/a512b3dbec3f401c3424e261558aa660 to your computer and use it in GitHub Desktop.
Save tiegz/a512b3dbec3f401c3424e261558aa660 to your computer and use it in GitHub Desktop.
Puck.js mute/unmute button for Zoom.
var kb = require("ble_hid_keyboard");
var led = 0;
LED!.write(led);
NRF.setServices(undefined, { hid : kb.report });
function btnPressed() {
// The shortcut on MacOS for mute/unmute is cmd-shift-a
kb.tap(kb.KEY.A, kb.MODIFY.SHIFT | kb.MODIFY.GUI, function() {
led = led == 0 ? 1 : 0;
LED2.write(led);
});
}
setWatch(btnPressed, BTN, {edge:"rising",repeat:true,debounce:50});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment