Neuron icon indicating copy to clipboard operation
Neuron copied to clipboard

Unable to bind [

Open Sservis opened this issue 4 years ago • 1 comments

Issue description: Attempted to bind [ to a button

Technical info:

Retail 1.4.0c

Additional context:

Speculation - Appears to be because the [ isn't escaped so lua thinks there's an error as it treats the keybind key as a lua [ and so there's a missing ]

Lua error log:

Neuron\Objects\KEYBINDER.lua:164: malformed pattern (missing ']') [string "=[C]"]: in function gsub' [string "@Neuron\Objects\KEYBINDER.lua"]:164: in function ClearBindings' [string "@Neuron\Objects\KEYBINDER.lua"]:235: in function <Neuron\Objects\KEYBINDER.lua:235> [string "=[C]"]: in function gsub' [string "@Neuron\Objects\KEYBINDER.lua"]:235: in function ProcessBinding' [string "@Neuron\Objects\KEYBINDER.lua"]:402: in function `OnKeyDown' [string "@Neuron\Objects\KEYBINDER.lua"]:51: in function <Neuron\Objects\KEYBINDER.lua:51>

Locals: (*temporary) = ":[:" (*temporary) = "[:" (*temporary) = ""

Sservis avatar Oct 19 '20 01:10 Sservis

Hrm, this is most certainly due to the "[" key being a special character in lua code. I.e. when you add that as a keybind it's trying to treat it as code behind the scenes rather than just a string. I should be able to address this, or at least I think, and worse case scenario I may need to blacklist square brackets (but I hope it doesn't come to that).

Thanks for catching this!

brittyazel avatar Oct 19 '20 02:10 brittyazel