Skip to content

Instantly share code, notes, and snippets.

@capjamesg
Created July 18, 2021 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save capjamesg/e7f27684170b9a4ed19bc0e3aa9141b2 to your computer and use it in GitHub Desktop.
Save capjamesg/e7f27684170b9a4ed19bc0e3aa9141b2 to your computer and use it in GitHub Desktop.
Some of my Keybow macros.
require "keybow"
muted = false
-- this code lets me press multiple keys at once (use a keyboard shortcut)
-- I found the modifier function online but cannot remember the source
function modifier(key, ...)
for i = 1, select('#', ...) do
local j = select(i, ...)
keybow.set_modifier(j, keybow.KEY_DOWN)
end
keybow.tap_key(key)
for i = 1, select('#', ...) do
local j = select(i, ...)
keybow.set_modifier(j, keybow.KEY_UP)
end
end
-- end zoom meeting
function handle_key_00(pressed)
if pressed then
modifier("q", keybow.LEFT_ALT)
reset_keys()
keybow.tap_enter()
end
end
-- mute zoom meeting
function handle_key_01(pressed)
if pressed then
modifier("a", keybow.LEFT_ALT)
if muted == false then
for i=0,11 do
keybow.set_pixel(i, 255, 0, 0)
end
muted = true
else
for i=0,11 do
keybow.set_pixel(i, 0, 255, 0)
end
muted = false
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment