Created
August 30, 2019 19:40
-
-
Save Lain818/2782e961ff506f347d5730dc7178b851 to your computer and use it in GitHub Desktop.
Basic LuaMacros Setup
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
clear() --clear the console from last run | |
local keyboardIdentifier = '13DD145D' | |
lmc_print_devices() | |
if keyboardIdentifier == '0000AAA' then | |
lmc_assign_keyboard('MACROS'); | |
else lmc_device_set_name('MACROS', keyboardIdentifier); | |
end | |
dev = lmc_get_devices() | |
for key,value in pairs(dev) do | |
print(key..':') | |
for key2,value2 in pairs(value) do print(' '..key2..' = '..value2) end | |
end | |
print('You need to get the identifier code for the keyboard with name "MACROS"') | |
print('Then replace the first 0000AAA value in the code with it. This will prevent having to manually identify keyboard every time.') | |
lmc.minimizeToTray = true | |
lmc_minimize() | |
lmc_set_handler('MACROS',function(button, direction) | |
if (direction == 1) then return end -- ignore down | |
if (button == 74) then lmc_spawn("calc") | |
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