Created
October 1, 2018 13:38
-
-
Save johnhw/d09250f619117247e8e4d13e150884bc to your computer and use it in GitHub Desktop.
Lua script for LuaMacros to configure Logitech R700 for presentation in Jupyter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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