This is misleading:
Code: Select all
if (RegExMatch(Value, "[^#+!^]")) return
The
return has no effect. It is interpreted as a variable, and is concatenated with the result of RegExMatch. The variable is empty, so it doesn't affect the result.
This is misleading:
Code: Select all
; check that hotkey is valid
if (RegExMatch(Value, "[^#+!^]"))
There are many invalid strings that this would consider to be valid hotkeys. It is safe to use only in the context of the Hotkey control, which always returns either a valid string of modifiers without a key (e.g.
^ corresponding to the text "Ctrl +"), or a valid hotkey.
It may be better to say "check that the hotkey is
complete" or "check that the value has something other than modifier symbols".
There is a possibility that it may give the wrong result if #+!^ are assigned directly to keys in the keyboard layout; i.e. if the Hotkey control can ever return
++ to mean Shift+plus. This does not happen with the US layout, because these characters are produced by holding Shift and pressing some other key.