Skip to content

Instantly share code, notes, and snippets.

@johnhw
Created October 1, 2018 13:38
Show Gist options
  • Save johnhw/d09250f619117247e8e4d13e150884bc to your computer and use it in GitHub Desktop.
Save johnhw/d09250f619117247e8e4d13e150884bc to your computer and use it in GitHub Desktop.
Lua script for LuaMacros to configure Logitech R700 for presentation in Jupyter
-- assign logical name to macro keyboard
lmc_assign_keyboard('MACROS');
view_mode = false
-- define callback for whole device
lmc_set_handler('MACROS',function(button, direction)
print(button)
if (direction == 1) then return end -- ignore down
if (button == 33) then lmc_send_keys("{ESC}{UP}")
elseif (button == 34) then lmc_send_keys("{ESC}{DOWN}")
elseif (button == 116 or button==27) then lmc_send_keys('^{ENTER}')
elseif (button == 190 and view_mode) then
lmc_send_keys('^m{F11}^0')
view_mode = not view_mode
elseif (button == 190 and not view_mode) then
lmc_send_keys('^m{F11}^0')
view_mode = not view_mode
else print('Not yet assigned: ' .. button)
end
end)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment