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>
Before Width: | Height: | Size: 378 KiB After Width: | Height: | Size: 378 KiB |
Before Width: | Height: | Size: 315 KiB After Width: | Height: | Size: 316 KiB |
Before Width: | Height: | Size: 182 KiB After Width: | Height: | Size: 182 KiB |
Before Width: | Height: | Size: 244 KiB After Width: | Height: | Size: 244 KiB |
|
@ -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;
|
||||
|
|
|
@ -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),
|
||||
|
|