You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- Define callback for whole device
lmc_set_handler('MACROS', function(button, direction)
if (direction == 1) then return end -- ignore key down events
if (button == 13) then -- Enter key on numpad
switchLayer()
else
local action = layers[currentLayer][string.char(button)]
if action then
action()
else
print('Not yet assigned: ' .. string.char(button))
end
end
end)
-- Function to switch to the next layer
function switchLayer()
currentLayer = currentLayer % #layers + 1
print('Switched to layer ' .. currentLayer)
end
The text was updated successfully, but these errors were encountered:
Not an issue but maybe a lifesaver :)
-- Assign logical name to macro keyboard
lmc_assign_keyboard('MACROS')
-- Define current active layer
local currentLayer = 1
-- Define keybindings for each layer
local layers = {
{
-- Layer 1: Default layer
['A'] = function() lmc_spawn("C:/Path/To/Application.exe") end,
['B'] = function() lmc_spawn("C:/Another/Path/To/Application.exe") end,
['C'] = function() lmc_spawn("C:/Yet/Another/Path/To/Application.exe") end,
['D'] = function() lmc_spawn("C:/One/More/Path/To/Application.exe") end,
},
{
-- Layer 2: Secondary layer
['E'] = function() lmc_spawn("C:/Path/To/Application.exe") end,
['F'] = function() lmc_spawn("C:/Another/Path/To/Application.exe") end,
['G'] = function() lmc_spawn("C:/Yet/Another/Path/To/Application.exe") end,
['H'] = function() lmc_spawn("C:/One/More/Path/To/Application.exe") end,
},
}
-- Define callback for whole device
lmc_set_handler('MACROS', function(button, direction)
if (direction == 1) then return end -- ignore key down events
end)
-- Function to switch to the next layer
function switchLayer()
currentLayer = currentLayer % #layers + 1
print('Switched to layer ' .. currentLayer)
end
The text was updated successfully, but these errors were encountered: