From 323d8101057698f8fdf0a6c176dd67be2ad0903d Mon Sep 17 00:00:00 2001 From: Romain Goyet Date: Sat, 19 Sep 2015 22:58:02 +0200 Subject: [PATCH] [ion] Simulator show keys in a matrix --- ion/src/simulator/keyboard/fltkkbd.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ion/src/simulator/keyboard/fltkkbd.cpp b/ion/src/simulator/keyboard/fltkkbd.cpp index 16a82857b..a9cf4d81e 100644 --- a/ion/src/simulator/keyboard/fltkkbd.cpp +++ b/ion/src/simulator/keyboard/fltkkbd.cpp @@ -1,8 +1,15 @@ +#include #include "fltkkbd.h" +#define KEYBOARD_ROWS 7 +#define KEYBOARD_COLUMNS 5 + FltkKbd::FltkKbd(int x, int y, int w, int h) : Fl_Group(x, y, w, h) { + assert(KEYBOARD_ROWS*KEYBOARD_COLUMNS == ION_NUMBER_OF_KEYS); + int key_width = w/KEYBOARD_COLUMNS; + int key_height = h/KEYBOARD_ROWS; for (int k=0; k