[ion] adjust simulator to new keyboard

Change-Id: Ib0baddf88f74621c21276746161d2d0bdb68942e
This commit is contained in:
Émilie Feral
2016-11-10 14:13:49 +01:00
parent e508bc47b7
commit 1556ec3d2b
2 changed files with 21 additions and 23 deletions

View File

@@ -20,7 +20,7 @@ enum class Key : uint8_t {
I1=48, I2=49, I3=50, I4=51, I5=52, // I6=53,
};
constexpr int NumberOfKeys = 53;
constexpr int NumberOfKeys = 54;
bool keyDown(Key k);

View File

@@ -1,33 +1,31 @@
#include <assert.h>
#include "fltkkbd.h"
constexpr int KeyboardRows = 10;
constexpr int KeyboardColumns = 5;
constexpr int KeyboardRows = 9;
constexpr int KeyboardColumns = 6;
static const char* kCharForKey[Ion::Keyboard::NumberOfKeys] = {
"F1", "F2", "F3", "F4", "F5",
"2nd", "Shift", "ESC", "LEFT", "UP",
"Diamond", "alpha", "APPS", "DOWN", "RIGHT",
"HOME", "MODE", "CTLG", "Delete", "CLEAR",
"X", "Y", "Z", "T", "^",
"=", "(", ")", ",", "%",
"|", "7", "8", "9", "x",
"EE", "4", "5", "6", "-",
"STO", "1", "2", "3", "+",
"ON", "0", ".", "(-)", "ENTER"
"Left", "Up", "Down", "Right", "OK", "Back",
"Home", "Power", "", "", "", "",
"Shift", "Alpha", "x,n,t", "Var", "Toolbox", "Clear",
"e^x", "ln", "log", "i", ",", "x^y",
"sin", "cos", "tan", "pi", "root", "square",
"7", "8", "9", "(", ")", "",
"4", "5", "6", "x", "%", "",
"1", "2", "3", "+", "-", "",
"0", ".", "x10^x", "Ans", "EXE", ""
};
static const int kShortcutForKey[Ion::Keyboard::NumberOfKeys] = {
0, 0, 0, 0, 0,
0, 0, FL_Escape, FL_Left, FL_Up,
0, 0, 0, FL_Down, FL_Right,
0, 0, 0, FL_BackSpace, 0,
'x', 'y', 'z', 't', '^',
'=', '(', ')', ',', '/',
0, '7', '8', '9', '*',
0, '4', '5', '6', '-',
0, '1', '2', '3', '+',
0, '0', '.', 0, FL_Enter
FL_Left, FL_Up, FL_Down, FL_Right, FL_Enter, FL_BackSpace,
FL_Escape, 0, 0, 0, 0, 0,
0, 0, 'x', 0, 0, 0,
0, 0, 0, 'i', ',', 0,
0, 0, 0, 0, 0, 0,
'7', '8', '0', '(',')', 0,
'4', '5', '6', '*', '%', 0,
'1', '2', '3', '+', '-', 0,
'0', '.', 0, 0, 0, 0
};
FltkKbd::FltkKbd(int x, int y, int w, int h) : Fl_Group(x, y, w, h) {