|
@@ -238,6 +238,12 @@ class _CalculatorPageState extends State<CalculatorPage> {
|
|
|
_doc.makeGroup();
|
|
_doc.makeGroup();
|
|
|
case _Act.power:
|
|
case _Act.power:
|
|
|
_doc.makePower();
|
|
_doc.makePower();
|
|
|
|
|
+ case _Act.subst:
|
|
|
|
|
+ // 代入骨架:`/. x -> `,光标落在最后,接着打要代进去的值就行。
|
|
|
|
|
+ // 变量是 x 的占多数;要代 t/y 就点一下那个 x 改掉。
|
|
|
|
|
+ _doc.insert(LitNode('/. '));
|
|
|
|
|
+ _doc.insert(LitNode('x'));
|
|
|
|
|
+ _doc.insert(LitNode(' -> '));
|
|
|
case _Act.brace:
|
|
case _Act.brace:
|
|
|
_doc.makeBrace();
|
|
_doc.makeBrace();
|
|
|
case _Act.frac:
|
|
case _Act.frac:
|
|
@@ -466,8 +472,10 @@ class _CalculatorPageState extends State<CalculatorPage> {
|
|
|
[
|
|
[
|
|
|
_Key('=', _Act.char, payload: '=', tint: true),
|
|
_Key('=', _Act.char, payload: '=', tint: true),
|
|
|
_Key('==', _Act.char, payload: '==', tint: true),
|
|
_Key('==', _Act.char, payload: '==', tint: true),
|
|
|
- _Key('/.', _Act.char, payload: '/.', tint: true),
|
|
|
|
|
- _Key('->', _Act.char, payload: '->', tint: true),
|
|
|
|
|
|
|
+ // /. 和 -> 永远成对出现(代入就是 `式子 /. x -> 值`),
|
|
|
|
|
+ // 合成一个键直接给出骨架,省一个位置给逗号(矩阵行分隔)
|
|
|
|
|
+ _Key('/.→', _Act.subst, tint: true),
|
|
|
|
|
+ _Key(',', _Act.comma),
|
|
|
_Key('{', _Act.brace, tint: true),
|
|
_Key('{', _Act.brace, tint: true),
|
|
|
],
|
|
],
|
|
|
// 5 数字与括号
|
|
// 5 数字与括号
|
|
@@ -504,7 +512,8 @@ class _CalculatorPageState extends State<CalculatorPage> {
|
|
|
[
|
|
[
|
|
|
_Key('⌫', _Act.back, tint: true),
|
|
_Key('⌫', _Act.back, tint: true),
|
|
|
_Key('CLR', _Act.clear, tint: true),
|
|
_Key('CLR', _Act.clear, tint: true),
|
|
|
- _Key(',', _Act.comma),
|
|
|
|
|
|
|
+ // 虚数单位。送进 Symja 的是 I,编辑框里显示小写 i
|
|
|
|
|
+ _Key('i', _Act.char, payload: 'I', tint: true, display: 'i'),
|
|
|
_Key('ANS', _Act.char, payload: '%', tint: true, display: 'ANS'),
|
|
_Key('ANS', _Act.char, payload: '%', tint: true, display: 'ANS'),
|
|
|
// 键盘负责"敲字符",✓ 负责"执行"。两者都叫 = 会撞车。
|
|
// 键盘负责"敲字符",✓ 负责"执行"。两者都叫 = 会撞车。
|
|
|
_Key('✓', _Act.commit, primary: true),
|
|
_Key('✓', _Act.commit, primary: true),
|
|
@@ -580,6 +589,7 @@ enum _Act {
|
|
|
fn,
|
|
fn,
|
|
|
fnPrefixed,
|
|
fnPrefixed,
|
|
|
bigOp,
|
|
bigOp,
|
|
|
|
|
+ subst,
|
|
|
brace,
|
|
brace,
|
|
|
sqrt,
|
|
sqrt,
|
|
|
group,
|
|
group,
|