diff --git a/qt_gui/main.cpp b/qt_gui/main.cpp index 196633a..98ead16 100644 --- a/qt_gui/main.cpp +++ b/qt_gui/main.cpp @@ -19,6 +19,7 @@ int main(int argc, char** argv) //fixed-width font for LCD QFont fixedFont = QFontDatabase::systemFont(QFontDatabase::FixedFont); fixedFont.setStyleHint(QFont::TypeWriter); + fixedFont.setPointSize(24); engine.rootContext()->setContextProperty("_fixedFont", fixedFont); //handle quit diff --git a/qt_gui/main.qml b/qt_gui/main.qml index 3eee92a..fdad647 100644 --- a/qt_gui/main.qml +++ b/qt_gui/main.qml @@ -59,7 +59,7 @@ ApplicationWindow color: "gray" border { width: 1; color: "black" } Text { - text: index + text: {getText(parent.parent.objectName, index)} anchors.centerIn: parent } MouseArea { @@ -71,4 +71,16 @@ ApplicationWindow } } } + + function getText(row, col) { + var keys = [ + ["Shift", "x<->y", "+/-", "C"], + ["7", "8", "9", "/"], + ["4", "5", "6", "*"], + ["1", "2", "3", "-"], + ["0", ".", "Enter", "+"] + ] + + return keys[row][col] + } } diff --git a/src/lcd_emulator.c b/src/lcd_emulator.c index 932e60a..1d56272 100644 --- a/src/lcd_emulator.c +++ b/src/lcd_emulator.c @@ -76,7 +76,7 @@ static int is_valid_character(char letter){ return 1; } else if(letter == CGRAM_EXP || letter == CGRAM_EXP_NEG){ return 1; - } else if(letter == '.' || letter == ' '){ + } else if(letter == '.' || letter == ' ' || letter == '-'){ return 1; }