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[{
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
"[", After],
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
"]", 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[{
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
"[", After],
FrontEnd`NotebookWrite[FrontEnd`InputNotebook[],
"]", 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.
Thanks in advance if anyone tries to answer my question :)
[ ]
pair? No modifications necessary. $\endgroup$AltGr-Alt-8
(AltGr-]
) does not yield any front end input for me. As a side note: PressingCtrl-Alt
is equivalent to pressingAltGr
on my keyboard. $\endgroup$Ctrl-A
,Ctrl-S
etc.) keyboard shortcuts do not work when keyboard locale is not set to English. Also the FrontEnd generally cannot handle correctly characters outside of Unicode level 0. $\endgroup$FrontEndExecute[FrontEndToken["InsertMatchingBrackets"]]
instead of the twoFrontEndExecute
s you used? $\endgroup$KeyEvent["["]
. In case there exists no proper solution I will just map[]
to)
, since I mapped()
to(
I dont really need the)
key anymore. $\endgroup$