[lua] Add Next/Prev shortcuts

wilder/palette
Jacopo De Simoi 5 years ago
parent 54b61e4adf
commit 08f480e204
  1. 11
      plugins/ColorCycle/main.lua

@ -8,6 +8,8 @@ app.registerUi({["menu"] = "Color 3", ["callback"] = "colorThree", ["accelerator
app.registerUi({["menu"] = "Color 4", ["callback"] = "colorFour", ["accelerator"] = "F18"});
app.registerUi({["menu"] = "Solid", ["callback"] = "solid", ["accelerator"] = "<Alt>F15"});
app.registerUi({["menu"] = "dash", ["callback"] = "dash", ["accelerator"] = "<Alt>F16"});
app.registerUi({["menu"] = "prev", ["callback"] = "prev", ["accelerator"] = "<Ctrl>F15"});
app.registerUi({["menu"] = "next", ["callback"] = "next", ["accelerator"] = "<Ctrl>F16"});
-- if you want to have multiple color lists you must use the app.registerUi function multiple times
-- with different callback functions and accelerators
end
@ -56,6 +58,15 @@ function dash()
app.uiAction({["action"]="ACTION_TOOL_LINE_STYLE_DOT"})
end
function next()
app.uiAction({["action"]="ACTION_GOTO_NEXT"})
end
function prev()
app.uiAction({["action"]="ACTION_GOTO_BACK"})
end
function cycle()
if (currentColor < #colorList) then
currentColor = currentColor + 1

Loading…
Cancel
Save