Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2002
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2002

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: KeyEventTranslations.tr.txt

  • To: mathgroup at smc.vnet.net
  • Subject: [mg37050] Re: KeyEventTranslations.tr.txt
  • From: Steven <hattons at speakeasy.net>
  • Date: Mon, 7 Oct 2002 05:25:09 -0400 (EDT)
  • References: <angi08$pvr$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Steven wrote:

> These are working for me.  If anybody wants to try this modified
> keymapping
> for Linux, have at it.  If you find anything wrong, please let me know.
> 
> http://66.92.149.152/proprietary/com/wri/proprietary/com/wri/ch05.html
> 
http://public.globalsymmetry.com/proprietary/com/wri/KeyEventTranslations.tr.txt
> 
> STH

I found a bug in my hack of the KeyEventTranslations.tr file which didn't 
manifest itself in 4.1, but did in 4.2.  I had a trailing ',' which was 
causing Mathematica to hang on startup after the chched KeyEventTranslations.m was 
created (second launch with the buggy file.)  I also discovered that the 
file I was trying to share had been chmod'ed to 400.  I am not sure if that 
is a daemon running, or scp which did it.  It's open now, and I'll keep an 
eye on it.

I'm attaching it as well, just in case.
I put it here on my box:

~/.Mathematica/SystemFiles/FrontEnd/TextResources


STH


@@resource KeyEventTranslations
(* Modifiers can be "Shift", "Control", "Command", "Option" 
	For Macintosh: "Command" = Command Key, "Option" = Option Key
	For X11: "Command" = Mod1, "Option" = Mod2
	For Windows: "Command" = Alt, "Option" = Alt

NOTE: I Hacked this for my purposes.  I find it more natural. There
may be problems.  It comes with all the warranty that GNU software does.

*)

EventTranslations[{

(* Evaluation *)
	Item[KeyEvent["Enter"], "EvaluateCells"], 
	Item[KeyEvent["KeypadEnter"], "EvaluateCells"], 
	Item[KeyEvent["Return", Modifiers -> {Shift}], "EvaluateCells"],
	Item[KeyEvent["KP_Enter"], "EvaluateCells"], 
	Item[KeyEvent["KeypadEnter", Modifiers -> {Shift}], "EvaluateNextCell"], 	
	Item[KeyEvent["KP_Enter", Modifiers -> {Shift}], "EvaluateNextCell"], 	
	Item[KeyEvent["Enter", Modifiers -> {Shift}], "EvaluateNextCell"], 
	Item[KeyEvent["Return", Modifiers -> {Command}], Evaluate[All]],
	Item[KeyEvent["Return", Modifiers -> {Option}], "SimilarCellBelow"], 
	Item[KeyEvent["Escape"], "ShortNameDelimiter"], 

(* Cursor control *)
	Item[KeyEvent["Up"], "MovePreviousLine"], 
	Item[KeyEvent["Down"], "MoveNextLine"], 
	Item[KeyEvent["Left"], "MovePrevious"], 
	Item[KeyEvent["Right"], "MoveNext"], 
	Item[KeyEvent["Up", Modifiers -> {Option}], "MovePreviousLine"], 
	Item[KeyEvent["Down", Modifiers -> {Option}], "MoveNextLine"], 
	Item[KeyEvent["Right", Modifiers -> {Option}], "MoveNextWord"], 
	Item[KeyEvent["Left", Modifiers -> {Option}], "MovePreviousWord"], 
	Item[KeyEvent["Right", Modifiers->{Control}], "MoveNextWord"], 
	Item[KeyEvent["Left", Modifiers->{Control}], "MovePreviousWord"], 
	Item[KeyEvent["End"], "MoveLineEnd"], 
	Item[KeyEvent["Home"], "MoveLineBeginning"], 

(* Selection *)
	Item[KeyEvent["Right", Modifiers -> {Shift}], "SelectNext"], 
	Item[KeyEvent["Left", Modifiers -> {Shift}], "SelectPrevious"], 
	Item[KeyEvent["Right", Modifiers -> {Control, Shift}], "SelectNextWord"], 
	Item[KeyEvent["Left", Modifiers -> {Control, Shift}], "SelectPreviousWord"], 
	Item[KeyEvent["Down", Modifiers -> {Shift}], "SelectNextLine"], 
	Item[KeyEvent["Up", Modifiers -> {Shift}], "SelectPreviousLine"], 
	Item[KeyEvent["Home", Modifiers -> {Shift}], "SelectLineBeginning"], 
	Item[KeyEvent["End", Modifiers -> {Shift}], "SelectLineEnd"], 
	Item[KeyEvent[".", Modifiers -> {Control}], "ExpandSelection"], 

(* Notebook window control *)
	Item[KeyEvent["PageUp"], "ScrollPageUp"], 
	Item[KeyEvent["PageDown"], "ScrollPageDown"], 
	Item[KeyEvent["Prior"], "ScrollPageUp"], 
	Item[KeyEvent["Next"], "ScrollPageDown"], 
	Item[KeyEvent["Home", Modifiers -> {Control}], "ScrollNotebookStart"], 
	Item[KeyEvent["End", Modifiers -> {Control}], "ScrollNotebookEnd"], 

(* Input *)
	Item[KeyEvent["Return"], "Linebreak"], 
	Item[KeyEvent["Tab"], "Tab"], 
	Item[KeyEvent["i", Modifiers -> {Control}], "Tab"], 
	Item[KeyEvent["Backspace"], "DeletePrevious"], 
	Item[KeyEvent["Delete"], "DeleteNext"], 
	Item[KeyEvent["ForwardDelete"], "DeleteNext"], 

(* Typesetting input *)
	Item[KeyEvent["6", Modifiers -> {Control}], "Superscript"], 
	Item[KeyEvent["Keypad6", Modifiers -> {Control}], "Superscript"], 
	Item[KeyEvent["^", Modifiers -> {Control}], "Superscript"], 
	Item[KeyEvent["-", Modifiers -> {Control}], "Subscript"], 
	Item[KeyEvent["_", Modifiers ->{Control}],  "Subscript"],
	Item[KeyEvent["/", Modifiers -> {Control}], "Fraction"], 
	Item[KeyEvent["KP_Divide", Modifiers -> {Control}], "Fraction"],
	Item[KeyEvent["2", Modifiers -> {Control}], "Radical"], 
	Item[KeyEvent["Keypad2", Modifiers -> {Control}], "Radical"], 
	Item[KeyEvent["@", Modifiers -> {Control}], "Radical"], 
	Item[KeyEvent["7", Modifiers -> {Control}], "Above"], 
	Item[KeyEvent["&", Modifiers -> {Control}], "Above"], 
	Item[KeyEvent["Keypad7", Modifiers -> {Control}], "Above"], 
	Item[KeyEvent["=", Modifiers -> {Control}], "Below"], 
	Item[KeyEvent["+", Modifiers -> {Control}], "Below"], 
	Item[KeyEvent[",", Modifiers -> {Control}], "NewColumn"], 
	Item[KeyEvent["Return", Modifiers -> {Control}], "NewRow"], 
	Item[KeyEvent["9", Modifiers -> {Control}], "CreateInlineCell"], 
	Item[KeyEvent["(", Modifiers -> {Control}], "CreateInlineCell"], 
	Item[KeyEvent["Keypad9", Modifiers -> {Control}], "CreateInlineCell"], 
	Item[KeyEvent[")", Modifiers -> {Control}], "MoveNextCell"], 
	Item[KeyEvent["0", Modifiers -> {Control}], "MoveNextCell"], 
	Item[KeyEvent["Keypad0", Modifiers -> {Control}], "MoveNextCell"], 
	Item[KeyEvent["Left", Modifiers -> {Control}, CellClass -> BoxFormData], "NudgeLeft"], 
	Item[KeyEvent["Right", Modifiers -> {Control}, CellClass -> BoxFormData], "NudgeRight"], 
	Item[KeyEvent["Down", Modifiers -> {Control}, CellClass -> BoxFormData], "NudgeDown"], 
	Item[KeyEvent["Up", Modifiers -> {Control}, CellClass -> BoxFormData], "NudgeUp"],
	Item[KeyEvent["8", Modifiers -> {Control}], "InsertRawExpression"],
	Item[KeyEvent["*", Modifiers -> {Control}], "InsertRawExpression"],
	Item[KeyEvent["Keypad8", Modifiers -> {Control}], "InsertRawExpression"],
	Item[KeyEvent["5", Modifiers -> {Control}, CellClass -> BoxFormData], "Otherscript"], 
	Item[KeyEvent["Keypad5", Modifiers -> {Control}, CellClass -> BoxFormData], "Otherscript"], 
	Item[KeyEvent["%", Modifiers -> {Control}, CellClass -> BoxFormData], "Otherscript"], 

(* Typesetting motion commands *)
	Item[KeyEvent[" ", Modifiers -> {Control}], "MoveExpressionEnd"], 
	Item[KeyEvent["Tab", Modifiers -> {Shift}, CellClass -> BoxFormData], "MovePreviousPlaceHolder"], 
	Item[KeyEvent["s", Modifiers -> {Command, Control}, CellClass -> BoxFormData], "MovePreviousExpression"], 
	Item[KeyEvent["S", Modifiers -> {Control, Command, Shift}, CellClass -> BoxFormData], "MoveNextExpression"], 
	Item[KeyEvent["S", Modifiers -> {Control, Shift}, CellClass -> BoxFormData], "DeleteNextExpression"], 
	Item[KeyEvent["s", Modifiers -> {Control}, CellClass -> BoxFormData], "DeletePreviousExpression"], 
	Item[KeyEvent["k", Modifiers -> {Control}], CompleteSelection[True]], 

(* Miscellaneous menu commands *)
	Item[KeyEvent["Delete", Modifiers -> {Control}], "Cut"],
	Item[KeyEvent["Insert", Modifiers -> {Control}], "Copy"], 
	Item[KeyEvent["Insert", Modifiers -> {Shift}], Paste[After]], 
	Item[KeyEvent["z", Modifiers -> {Control}], "Undo"],
        Item[KeyEvent["c", Modifiers -> {Control}], "Copy"],
	Item[KeyEvent["x", Modifiers -> {Control}], "Cut"],
        Item[KeyEvent["v", Modifiers -> {Control}], Paste[After]],  
	Item[KeyEvent["F1"], "SelectionHelpDialog"] 
	
(* Unsupported features and examples *)
(*  	Item[KeyEvent["v", Modifiers -> {Control}], "SelectionSpeakSummary"], *)
(*  	Item[KeyEvent["v", Modifiers -> {Control, Shift}], "SelectionSpeak"] *)
}]


  • Prev by Date: Re: Which fonts do I need to make Linux Stop Chirping?
  • Next by Date: Mathematica with Excel
  • Previous by thread: KeyEventTranslations.tr.txt
  • Next by thread: BinaryImport