From 1556ec3d2b6067628c74a73ff07e2d1443725e01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 10 Nov 2016 14:13:49 +0100 Subject: [PATCH] [ion] adjust simulator to new keyboard Change-Id: Ib0baddf88f74621c21276746161d2d0bdb68942e --- ion/include/ion/keyboard.h | 2 +- ion/src/simulator/keyboard/fltkkbd.cpp | 42 ++++++++++++-------------- 2 files changed, 21 insertions(+), 23 deletions(-) diff --git a/ion/include/ion/keyboard.h b/ion/include/ion/keyboard.h index b2924c9ed..c6d5e8780 100644 --- a/ion/include/ion/keyboard.h +++ b/ion/include/ion/keyboard.h @@ -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); diff --git a/ion/src/simulator/keyboard/fltkkbd.cpp b/ion/src/simulator/keyboard/fltkkbd.cpp index 1a692c426..7c8b88809 100644 --- a/ion/src/simulator/keyboard/fltkkbd.cpp +++ b/ion/src/simulator/keyboard/fltkkbd.cpp @@ -1,33 +1,31 @@ #include #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) {