From 08f480e204db93cf5962d375724dc17778a3a69b Mon Sep 17 00:00:00 2001 From: Jacopo De Simoi Date: Thu, 5 Aug 2021 23:30:21 -0400 Subject: [PATCH] [lua] Add Next/Prev shortcuts --- plugins/ColorCycle/main.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/ColorCycle/main.lua b/plugins/ColorCycle/main.lua index 03f5c3e0..71dcbb5a 100644 --- a/plugins/ColorCycle/main.lua +++ b/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"] = "F15"}); app.registerUi({["menu"] = "dash", ["callback"] = "dash", ["accelerator"] = "F16"}); +app.registerUi({["menu"] = "prev", ["callback"] = "prev", ["accelerator"] = "F15"}); +app.registerUi({["menu"] = "next", ["callback"] = "next", ["accelerator"] = "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