# Automatic replacing of [ with []

I tried to modify the KeyEventTranslations.tr file in order to always place a closed bracket instead of an open bracket once I press [. However once I press [ after the modification nothing happens (the cursor just stays at the same position and not even a [ is placed).

Item[KeyEvent["["],
FrontEndExecute[{
FrontEndNotebookWrite[FrontEndInputNotebook[],
"[", After],
FrontEndNotebookWrite[FrontEndInputNotebook[],
"]", Before]
}]],

the Code is a slight modification of what i found regarding double brackets:

Automating Esc [[ Esc formatting?

(There is a comment below the top answer, which also mentions Problems regarding [ and German keyboard language).

If I use a different character like / to trigger the KeyEvent, which does not have to be typed using the AltGr-key

Item[KeyEvent["/"],
FrontEndExecute[{
FrontEndNotebookWrite[FrontEndInputNotebook[],
"[", After],
FrontEndNotebookWrite[FrontEndInputNotebook[],
"]", Before]
}]],

the closed bracket will be placed as expected. Other keys like { using AltGr do not work either.

I tried renaming the term.dll files as suggested here:

Is it possible to get AltGr key to work in Math.exe?

unfortunately this did not fix the Problem.

Additional Information: I'm using Win7 and my keyboard language is set to German. (And I would like to keep it set to German).

If there is any other way circumventing the KeyEventTranslations.tr to automaticaly place [] with the cursor placed between the brackets once I press [, it would be fine as well.