From d81fa20f32d6285731248405d47fc34b8e612073 Mon Sep 17 00:00:00 2001 From: Sebastien Braun Date: Tue, 12 Oct 2010 06:12:20 +0200 Subject: Fix control character handling bug. The code to deal with lowercase and uppercase versions of Latin1 characters was overly broad and sent ASCII Control Characters if Ctrl was pressed. --- src/gui/frame.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/gui/frame.cpp b/src/gui/frame.cpp index b9899d8..12d49bc 100644 --- a/src/gui/frame.cpp +++ b/src/gui/frame.cpp @@ -538,8 +538,18 @@ void Frame::keyPressEvent(QKeyEvent* event) QString text = event->text(); if(text.length() == 1 && text.at(0).row() == 0) { - // We found a Latin1 char and pray it is the correct case. - key = text.at(0).cell(); + QChar c = text.at(0); + + // The next problem is that it may be a control character. + // This happens when Ctrl is pressed, so we only + // modify keys if they are lowercase or uppercase + // versions of the keycode. + + if(c.toLower().toLatin1() == key || c.toUpper().toLatin1() == key) + { + // We found a Latin1 char and pray it is the correct case. + key = c.cell(); + } } } sendInputEvent(InputEvent::keyboardPress(key, event->modifiers())); -- cgit v1.2.3-55-g7522