Skip to main content
There was a second question - but the question arose from my mistake. So I erase the second question.
Source Link
imida k
  • 4.3k
  • 10
  • 20

About editing KeyEventTranslations.tr

First Question)

Item[KeyEvent["q", Modifiers -> {Control}], "MoveNextWord"] : working

Item[KeyEvent["y", Modifiers -> {Control}], "MoveNextWord"] : not working

For the same instruction, some combination of keys work, other combination of keys not work.

Why?

Second Question)

After disabling the following preexisting code in KeyEventTranslations.tr(deleting or wrapping it to a comment)

(* Item[KeyEvent["Home", Modifiers -> {Shift}], "SelectLineBeginning"] *) <- wrapped to a comment

then, if I add

Item[KeyEvent["Home", Modifiers -> {Shift}], FrontEndExecute[FrontEnd`NotebookWrite[SelectedNotebook[], "WriteThis"]]]

:working

So it has been verified that 'FrontEndExecute~~blahblah~~WriteThis' code is a working code.

Note that we verified that 'Ctrl + q' is an accepted key combination in first question.

But rather strangely,

Item[KeyEvent["q", Modifiers -> {Control}], FrontEndExecute[FrontEnd`NotebookWrite[SelectedNotebook[], "WriteThis"]]]

: not working

So for the same key combination, some instruction(= code) works, other instruction not works. Why ?

About editing KeyEventTranslations.tr

First Question)

Item[KeyEvent["q", Modifiers -> {Control}], "MoveNextWord"] : working

Item[KeyEvent["y", Modifiers -> {Control}], "MoveNextWord"] : not working

For the same instruction, some combination of keys work, other combination of keys not work.

Why?

Second Question)

After disabling the following preexisting code in KeyEventTranslations.tr(deleting or wrapping it to a comment)

(* Item[KeyEvent["Home", Modifiers -> {Shift}], "SelectLineBeginning"] *) <- wrapped to a comment

then, if I add

Item[KeyEvent["Home", Modifiers -> {Shift}], FrontEndExecute[FrontEnd`NotebookWrite[SelectedNotebook[], "WriteThis"]]]

:working

So it has been verified that 'FrontEndExecute~~blahblah~~WriteThis' code is a working code.

Note that we verified that 'Ctrl + q' is an accepted key combination in first question.

But rather strangely,

Item[KeyEvent["q", Modifiers -> {Control}], FrontEndExecute[FrontEnd`NotebookWrite[SelectedNotebook[], "WriteThis"]]]

: not working

So for the same key combination, some instruction(= code) works, other instruction not works. Why ?

About editing KeyEventTranslations.tr

Item[KeyEvent["q", Modifiers -> {Control}], "MoveNextWord"] : working

Item[KeyEvent["y", Modifiers -> {Control}], "MoveNextWord"] : not working

For the same instruction, some combination of keys work, other combination of keys not work.

Why ?

Source Link
imida k
  • 4.3k
  • 10
  • 20

KeyEventTranslations.tr shortcut setting - work/not work

About editing KeyEventTranslations.tr

First Question)

Item[KeyEvent["q", Modifiers -> {Control}], "MoveNextWord"] : working

Item[KeyEvent["y", Modifiers -> {Control}], "MoveNextWord"] : not working

For the same instruction, some combination of keys work, other combination of keys not work.

Why?

Second Question)

After disabling the following preexisting code in KeyEventTranslations.tr(deleting or wrapping it to a comment)

(* Item[KeyEvent["Home", Modifiers -> {Shift}], "SelectLineBeginning"] *) <- wrapped to a comment

then, if I add

Item[KeyEvent["Home", Modifiers -> {Shift}], FrontEndExecute[FrontEnd`NotebookWrite[SelectedNotebook[], "WriteThis"]]]

:working

So it has been verified that 'FrontEndExecute~~blahblah~~WriteThis' code is a working code.

Note that we verified that 'Ctrl + q' is an accepted key combination in first question.

But rather strangely,

Item[KeyEvent["q", Modifiers -> {Control}], FrontEndExecute[FrontEnd`NotebookWrite[SelectedNotebook[], "WriteThis"]]]

: not working

So for the same key combination, some instruction(= code) works, other instruction not works. Why ?