Can't enter square brackets in code window

Why don’t you just always include cmd/ctrl (mac/other) as one of the modifier keys required to press for a shortcut?
cmd/ctrl isn’t used to enter an alternate key ever, so the problem should never occur.

Using Windows you have 3 different characters on every key, that can be typed with no modifier, shift and alt gr (IIRC). When Using OS X you have 4 different characters which can be typed with no modifier, shift, alt and alt+shift.

You should never use any of these modifiers as shortcut keys, as it will cause problems like this.