# Alt+Gr issue with Mathematica 7 on linux

I have the same issue as described in

https://matteochinazzi.wordpress.com/2010/04/12/mathematica-alt-gr-issue-under-linux/

So basically whenever I use AltGr to write [ or ] in Mathematica, it automatically creates one blank space before the bracket symbol. The above fix, however, crashes my Mathematica on startup, I get the error message:

A serious error has occurred while Mathematica was starting up. Mathematica will probably not function properly until this problem is resolved. You may choose to continue anyway, but Mathematica may crash or exit without warning

There was a syntax error on line 10 in text resource KeyEventTranslations. The error was: @@resource KeyEv

For me this error message is no help, since it says that the code from the blog I linked above does not work, but gives no clues to what exactly is wrong. Did anyone here encounter the same problem, or has any ideas?

Important info: This occurs on a QWERTZ keyboard layout.

• Well, I cannot really help you, but just to note that this problem does not occur on a UK keyboard. There are no problems in that case with characters typed using AltGr. – Oleksandr R. May 28 '15 at 12:58
• Oh I completely forgot to include that I am using a QWERTZ keyboard layout. Sorry, I will edit that in. – pandam0n1um May 28 '15 at 13:04

and add the following new line after EventTranslations[{:
Item[KeyEvent["ISO_Level3_Shift"],
FrontEndExecute[{FrontEndNotebookWrite[FrontEndInputNotebook[],