Neuron

Neuron

98.2k Downloads

Unable to bind [

Sservis opened this issue ยท 1 comments

commented

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) = ""

commented

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!