keys: Update key layout for easier matrix/vector entry

Map shift-9 to enter matrices and vector, and delegate `MatrixMenu` to
secondary shift. The `MatrixMenu` is easy to access through the
`ToolMenu` anyway as soon as a matrix is on the stack, so having a
single-shifted menu is not that important.

Fixes: #198

Signed-off-by: Christophe de Dinechin <christophe@dinechin.org>
This commit is contained in:
Christophe de Dinechin 2023-07-25 21:07:26 +02:00
parent 488bec73a6
commit 0cdbe65a59
6 changed files with 14 additions and 4 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 KiB

After

Width:  |  Height:  |  Size: 378 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 315 KiB

After

Width:  |  Height:  |  Size: 316 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 182 KiB

After

Width:  |  Height:  |  Size: 182 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

After

Width:  |  Height:  |  Size: 244 KiB

View file

@ -2443,8 +2443,8 @@ tests &tests::itest(cstring txt)
case '^': k = INV; alpha = true; shift = true; break;
case '(': k = XEQ; alpha = true; shift = true; del = true; break;
case ')': k = XEQ; alpha = true; shift = true; bsp = true; break;
case '[': k = KEY9; alpha = true; xshift = true; del = true; break;
case ']': k = KEY9; alpha = true; xshift = true; bsp = true; break;
case '[': k = KEY9; alpha = false; shift = true; del = true; break;
case ']': k = KEY9; alpha = false; shift = true; bsp = true; break;
case '{': k = RUNSTOP; alpha = true; xshift = true; del = true; break;
case '}': k = RUNSTOP; alpha = true; xshift = true; bsp = true; break;
case '"': k = ENTER; alpha = true; xshift = true; bsp = true; break;

View file

@ -2561,6 +2561,16 @@ bool user_interface::handle_editing(int key)
return true;
}
break;
case KEY_9:
if (shift)
{
// Shift-9 enters a matrix
edit('[', MATRIX);
last = 0;
return true;
}
break;
}
}
@ -3035,7 +3045,7 @@ static const byte defaultShiftedCommand[2*user_interface::NUM_KEYS] =
OP2BYTES(KEY_UP, 0),
OP2BYTES(KEY_7, menu::ID_SolverMenu),
OP2BYTES(KEY_8, menu::ID_SymbolicMenu),
OP2BYTES(KEY_9, menu::ID_MatrixMenu),
OP2BYTES(KEY_9, 0), // Insert []
OP2BYTES(KEY_DIV, menu::ID_StatisticsMenu),
OP2BYTES(KEY_DOWN, 0),
OP2BYTES(KEY_4, menu::ID_BasesMenu),
@ -3092,7 +3102,7 @@ static const byte defaultSecondShiftedCommand[2*user_interface::NUM_KEYS] =
OP2BYTES(KEY_UP, 0),
OP2BYTES(KEY_7, 0),
OP2BYTES(KEY_8, 0),
OP2BYTES(KEY_9, 0),
OP2BYTES(KEY_9, menu::ID_MatrixMenu),
OP2BYTES(KEY_DIV, 0),
OP2BYTES(KEY_DOWN, 0),
OP2BYTES(KEY_4, 0),