自定义Mathematica快捷方式

时间:2010-11-17 21:36:52

标签: wolfram-mathematica

我可以查看/更改全局快捷方式选项,例如 Command + 9 (转换为输入样式)吗?

特别是,我需要一种更快速的方法来创建项目符号列表。它是Cell上下文菜单中的“Item”样式,它没有自己的快捷方式。

2 个答案:

答案 0 :(得分:30)

Here是一篇不错的文章。

此外,FROM HERE(未选中)

  

问题:   如何修改前端以添加新的键盘快捷键?   回答:   (数学组2005年5月,特雷弗巴卡:)

     

我最近在KeyEventTranslations.tr中设置键盘快捷键,我已经了解到前端令牌非常酷。 this wolfram page提供了非常好的文档。

     

无论如何,这里有三个我必须努力工作(在数学小组的帮助下,一如既往)。

  • 对于退出内核键盘快捷键,将以下内容添加到KeyEventTranslations.tr:
       Item[KeyEvent["q", Modifiers -> {Control, Option}],
               FrontEndExecute[
                       FrontEndToken[
                                SelectedNotebook[ ],
                                "EvaluatorQuit",
                                Automatic
                       ]
               ]
       ]  

  • 用于初始化单元格切换键盘快捷键(从上一个线程重复),将以下内容添加到KeyEventTranslations.tr:
      Item[KeyEvent["i", Modifiers -> {Command, Control}],
               FrontEndExecute[
                       FrontEndToken[
                               SelectedNotebook[ ],
                               "InitializationCell",
                               "Toggle"
                       ]
               ]
       ]  
  • 对于另存为包键盘快捷键,请将以下内容添加到KeyEventTranslations.tr:
       Item[KeyEvent["k", Modifiers -> {Control, Option}], 
           SaveRenameSpecial["Package"]]

修改

我找到了(未记录的)前端令牌的完整列表。希望你能理解这些都不受支持!

{"AllWindowsFront", "BackgroundDialog", "Balance", "BringToFront",
"CellContextDialog", "CellGroup", "CellLabelsToTags", "CellMerge",
"CellSplit", "CellTagsEditDialog", "CellTagsEmpty", "CellTagsFind",
"CellUngroup", "Clear", "ClearCellOptions", "ClearNoAutoScroll",
"Close", "CloseAll", "CloseMain", "ColorSelectorDialog",
"ColorsPanel", "CompleteSelection", "Copy", "CopyCell",
"CopySpecial", "CreateCounterBoxDialog", "CreateGridBoxDialog",
"CreateHyperlinkDialog", "CreateInlineCell", "CreateValueBoxDialog",
"Cut", "CycleNotebooksBackward", "CycleNotebooksForward",
"DebuggerAbort", "DebuggerClearAllBreakpoints", "DebuggerContinue",
"DebuggerContinueToSelection", "DebuggerFinish",
"DebuggerResetProfile", "DebuggerShowProfile", "DebuggerStep",
"DebuggerStepIn", "DebuggerStepInBody", "DebuggerStepOut",
"DebuggerToggleBreakpoint", "DebuggerToggleWatchpoint",
"DeleteGeneratedCells", "DeleteIndent", "DeleteInvisible",
"DuplicatePreviousInput", "DuplicatePreviousOutput",
"EditStyleDefinitions", "EnterSubsession", "Evaluate",
"EvaluateCells", "EvaluateInitialization", "EvaluateNextCell",
"EvaluateNotebook", "EvaluatorAbort", "EvaluatorHalt",
"EvaluatorInterrupt", "EvaluatorQuit", "EvaluatorStart",
"ExitSubsession", "ExpirationDialog", "ExplainBeepDialog",
"ExplainColoringDialog", "ExpressionLinewrap", "FileNameDialog",
"FindDialog", "FindEvaluatingCell", "FindNextMisspelling",
"FindNextWarningColor", "FinishNesting", "FixCellHeight",
"FixCellWidth", "FontColorDialog", "FontFamilyB", "FontPanel",
"FontSizeDialog", "FrontEndHide", "FrontEndQuit",
"FrontEndQuitNonInteractive", "GenerateImageCaches",
"GenerateNotebook", "GeneratePalette", "GraphicsAlign",
"GraphicsCoordinatesDialog", "GraphicsOriginalSize",
"GraphicsPlotRangeAll", "GraphicsPlotRangeAutomatic",
"GraphicsPlotRangeFixed", "GraphicsRender", "Group",
"HandleShiftReturn", "HeadersFootersDialog", "HelpDialog",
"HyperlinkGo", "HyperlinkGoBack", "HyperlinkGoForward", "Import",
"ImportPictures", "ImportStyleDefinitions", "Indent",
"InsertClipPlane", "InsertMatchingBraces", "InsertMatchingBrackets",
"InsertMatchingParentheses", "InsertNewGraphic", "InsertObject",
"InsertRawExpression", "InsertSoftReturn", "LicAuthFailureDialog",
"MacintoshOpenDeskAccessory", "MenuListBoxFormFormatTypes",
"MenuListCellEvaluators", "MenuListCellTags",
"MenuListCommonDefaultFormatTypesInput",
"MenuListCommonDefaultFormatTypesInputInline",
"MenuListCommonDefaultFormatTypesOutput",
"MenuListCommonDefaultFormatTypesOutputInline",
"MenuListCommonDefaultFormatTypesText",
"MenuListCommonDefaultFormatTypesTextInline",
"MenuListConvertFormatTypes", "MenuListDisplayAsFormatTypes",
"MenuListExportClipboardSpecial", "MenuListFonts",
"MenuListFontSubstitutions", "MenuListGlobalEvaluators",
"MenuListHelpWindows", "MenuListNotebookEvaluators",
"MenuListNotebooksMenu", "MenuListPackageWindows",
"MenuListPalettesMenu", "MenuListPaletteWindows",
"MenuListPlayerWindows", "MenuListPlugInCommands",
"MenuListPrintingStyleEnvironments", "MenuListQuitEvaluators",
"MenuListRelatedFilesMenu", "MenuListSaveClipboardSpecial",
"MenuListScreenStyleEnvironments", "MenuListStartEvaluators",
"MenuListStyleDefinitions", "MenuListStyles",
"MenuListStylesheetWindows", "MenuListTextWindows",
"MenuListWindows", "ModifyBoxFormFormatTypes",
"ModifyDefaultFontProperties", "ModifyEvaluatorNames",
"ModifyFontSubstitutions", "ModifyNotebooksMenu",
"ModifyRelatedFiles", "MoveBackward", "MoveForward", "MoveToBack",
"MoveToFront", "New", "NewPackage", "NewText",
"NextFunctionTemplate", "NotebookMail", "NotebookMailSelection",
"NotebookOneNote", "NotebookOneNoteSelection",
"NotebookStatisticsDialog", "Open", "OpenCloseGroup",
"OpenFromNotebooksMenu", "OpenFromNotebooksMenuEmpty",
"OpenFromPalettesMenu", "OpenFromRelatedFilesMenu", "OpenHelpLink",
"OpenSelection", "OpenSelectionParents", "OpenURL", "OptionsDialog",
"PasswordDialog", "Paste", "PasteApply", "PasteApplyNoAutoScroll",
"PasteDiscard", "PasteDiscardNoAutoScroll", "PasteSpecial",
"PlainFont", "PreferencesDialog", "PreviousFunctionTemplate",
"PrintDialog", "PrintOptionsDialog", "PrintSelectionDialog",
"PublishToPlayer", "RebuildHelpIndex", "RecordSoundDialog",
"RefreshDynamicObjects", "RelatedFilesMenu",
"RemoveFromEvaluationQueue", "Replace", "ReplaceAll", "ReplaceFind",
"ReplaceParent", "Revert", "RunColorDialog", "RunEdgeColorDialog",
"RunFaceColorDialog", "Save", "SaveRename", "SaveRenameSpecial",
"ScrollLineDown", "ScrollLineUp", "ScrollNotebookEnd",
"ScrollNotebookStart", "ScrollPageBottom", "ScrollPageDown",
"ScrollPageFirst", "ScrollPageLast", "ScrollPageNext",
"ScrollPagePrevious", "ScrollPageTop", "ScrollPageUp",
"SelectGeneratedCells", "SelectionAnimate", "SelectionBrace",
"SelectionBracket", "SelectionCloseAllGroups",
"SelectionCloseUnselectedCells", "SelectionConvert",
"SelectionConvertB", "SelectionDisplayAs", "SelectionDisplayAsB",
"SelectionHelpDialog", "SelectionOpenAllGroups",
"SelectionParenthesize", "SelectionSaveSpecial", "SelectionScroll",
"SelectionSetFind", "SelectionSpeak", "SelectionSpeakSummary",
"SelectionUnbracket", "SelectNotebookWindow", "SetDefaultGraphic",
"SimilarCellBelow", "SoundPlay", "SpellCheckerDialog",
"StackWindows", "Style", "StyleDefinitionsOther", "StyleOther",
"SubsessionEvaluateCells", "SystemPrintOptionsDialog",
"TemplateSelection", "TestEvaluateNotebook", "TileWindowsTall",
"TileWindowsWide", "ToggleDebugFlag", "ToggleDynamicUpdating",
"ToggleGrayBox", "ToggleOptionListElement", "ToggleShowExpression",
"ToggleTestingFlag", "TrustNotebook", "Undo", "Ungroup",
"WindowMiniaturize", "XInfoDialog", "ZoomWindow"}

答案 1 :(得分:7)

不同类型单元格的快捷方式存储在Stylesheet中。 选择所需的样式并更改 MenuKeyCommand MenuCommandKey值。 Option Inspector中的下拉选项只允许你使用1-9,但我用“`”和“=”进行了测试,它们运行良好。有时,使用Show Expression(Ctrl-Shift-E)而非Option Inspector更容易修改样式表。