diff options
author | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-05-28 11:11:29 (GMT) |
---|---|---|
committer | Tom Cooksey <thomas.cooksey@nokia.com> | 2009-05-28 12:13:34 (GMT) |
commit | 353afc392b843519023f27753b45b2e6fd9467ff (patch) | |
tree | 44d96f942d6a2cc1e7e6e7dd0abae87ab68a30f5 | |
parent | 8ed5931925b4e8ed8f098b5c36e1378f95d7d25a (diff) | |
download | Qt-353afc392b843519023f27753b45b2e6fd9467ff.zip Qt-353afc392b843519023f27753b45b2e6fd9467ff.tar.gz Qt-353afc392b843519023f27753b45b2e6fd9467ff.tar.bz2 |
Don't assume the tty was in K_XLATE when application started
Instead, query the mode at startup, store it and restore it on exit.
Reviewed-By: TrustMe
Task-number: 254194
-rw-r--r-- | src/gui/embedded/qkbdtty_qws.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp index b588e55..7c162bc 100644 --- a/src/gui/embedded/qkbdtty_qws.cpp +++ b/src/gui/embedded/qkbdtty_qws.cpp @@ -97,6 +97,7 @@ private slots: private: QWSPC101KeyboardHandler *handler; struct termios origTermData; + int originalKbdMode; }; QWSTtyKeyboardHandler::QWSTtyKeyboardHandler(const QString &device) @@ -156,6 +157,7 @@ QWSTtyKbPrivate::QWSTtyKbPrivate(QWSPC101KeyboardHandler *h, const QString &devi tcgetattr(kbdFD, &termdata); #if defined(Q_OS_LINUX) + ioctl(kbdFD, KDGKBMODE, &originalKbdMode); # ifdef QT_QWS_USE_KEYCODES ioctl(kbdFD, KDSKBMODE, K_MEDIUMRAW); # else @@ -202,7 +204,7 @@ QWSTtyKbPrivate::~QWSTtyKbPrivate() { if (kbdFD >= 0) { #if defined(Q_OS_LINUX) - ioctl(kbdFD, KDSKBMODE, K_XLATE); + ioctl(kbdFD, KDSKBMODE, originalKbdMode); #endif tcsetattr(kbdFD, TCSANOW, &origTermData); ::close(kbdFD); |