本文介绍了如何重新定义FrontEndEventActions?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
美好的一天,
此问题来自有关中止评估的问题输入的全部顺序.
我认为可以通过为两个事件重新定义FrontEndEventActions
来实现所需的行为:"EvaluateCells"
(或按 + )并按 + .应该是这样的:
I think it is probably possible to achieve the desired behavior by redefining FrontEndEventActions
for two events: "EvaluateCells"
(or pressing +) and for pressing +. It should be something like:
SetOptions[$FrontEndSession,
FrontEndEventActions -> {"EvaluateCells" :> Last$PreRead,
{{"Alt", "."} :> AbortAllNextInputs}}]
或
SetOptions[$FrontEndSession,
FrontEndEventActions -> {{{"ShiftKey", "ReturnKeyDown"} :> Last$PreRead}
{{"Alt", "."} :> AbortAllNextInputs}}]
其中AbortAllNextInputs
和Last$PreRead
的定义如下:
AbortAllNextInputs := AbortProtect[
$new$PreRead = True;
last$PreRead = ToString[Definition[$PreRead], InputForm];
ClearAll[$PreRead];
$PreRead := # &] /; ! TrueQ[$new$PreRead]
Last$PreRead :=
$PreRead := AbortProtect[
$new$PreRead = False;
ClearAll[$PreRead];
If[last$PreRead === "Null", #,
ToExpression[last$PreRead]; $PreRead@#]
] &
但是我无法使FrontEndEventActions
工作.谁能帮我吗?
But I can not get FrontEndEventActions
working. Can anyone help me?
推荐答案
我认为您需要按照和此处.
这篇关于如何重新定义FrontEndEventActions?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!