From a8f2152c9256bc2dae6866d5d674acbd34a8602a Mon Sep 17 00:00:00 2001 From: "G.K.MacGregor" Date: Mon, 20 Jun 2022 18:30:53 +0100 Subject: [PATCH] Try fixing the "unknown keypress types a block character" --- mainwidget.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mainwidget.cpp b/mainwidget.cpp index c4ac08c..81c8660 100644 --- a/mainwidget.cpp +++ b/mainwidget.cpp @@ -250,8 +250,8 @@ void TeletextWidget::keyPressEvent(QKeyEvent *event) if (event->key() < 0x01000000) { // A character-typing key was pressed // Try to keymap it, if not keymapped then plain ASCII code (may be) returned - char mappedKeyPress = keymapping[m_pageDecode.level1CharSet(m_teletextDocument->cursorRow(), m_teletextDocument->cursorColumn())].value(event->text().at(0), *qPrintable(event->text())); - if (mappedKeyPress < 0x20) + char mappedKeyPress = keymapping[m_pageDecode.level1CharSet(m_teletextDocument->cursorRow(), m_teletextDocument->cursorColumn())].value(event->text().at(0), *qPrintable(event->text().at(0))); + if (mappedKeyPress >= 0x00 && mappedKeyPress <= 0x1f) return; // If outside ASCII map then the character can't be represented by current Level 1 character set // Map it to block character so it doesn't need to be inserted-between later on