diff options
author | 2021-11-05 02:46:04 +1100 | |
---|---|---|
committer | 2021-11-05 02:46:04 +1100 | |
commit | de9ed121867b8665060fb91fc1dbee0dfa3ca6fa (patch) | |
tree | 790bf80e2da36d3c9cc0542514a96aae2fe7b467 /plugins/inputmacro/init.lua | |
parent | f196989f8bbd8163b58aaf20f64904eafbfea52f (diff) |
plugins: Reduced amnesia for autofire and inputmacro plugins.
Made autofire and inputmacro plugins capable of remembering settings if
the host input device for the binding is missing or if an input for a
slot device that isn't present is referenced.
Diffstat (limited to 'plugins/inputmacro/init.lua')
-rw-r--r-- | plugins/inputmacro/init.lua | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/plugins/inputmacro/init.lua b/plugins/inputmacro/init.lua index fc2ed2481f0..36d7aeeca2e 100644 --- a/plugins/inputmacro/init.lua +++ b/plugins/inputmacro/init.lua @@ -15,11 +15,14 @@ function inputmacro.startplugin() Configuration data: * name: display name (string) * binding: activation sequence (input sequence) + * bindingcfg: activation sequence configuration (string) * earlycancel: cancel or complete on release (Boolean) - * loop: -1 = release, 0 = prolong, >0 = loop to step on hold (int) + * loop: -1 = release, 0 = prolong, >0 = loop to step on hold (integer) * steps: * inputs: - * port: port (I/O port) + * port: port tag (string) + * mask: port field mask (integer) + * type: port field type (integer) * field: field (I/O port field) * delay: delay before activating inputs in frames (integer) * duration: duration to activate inputs for (integer) @@ -35,7 +38,9 @@ function inputmacro.startplugin() local function activate_inputs(inputs) for index, input in ipairs(inputs) do - active_inputs[string.format('%s.%d.%d', input.port.tag, input.field.mask, input.field.type)] = input.field + if input.field then + active_inputs[string.format('%s.%d.%d', input.port, input.mask, input.type)] = input.field + end end end |