summaryrefslogtreecommitdiffstats
path: root/src/gui/embedded
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/embedded')
-rw-r--r--src/gui/embedded/qkbdtty_qws.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/embedded/qkbdtty_qws.cpp b/src/gui/embedded/qkbdtty_qws.cpp
index 31489cf..3489278 100644
--- a/src/gui/embedded/qkbdtty_qws.cpp
+++ b/src/gui/embedded/qkbdtty_qws.cpp
@@ -89,6 +89,7 @@ private:
struct termios m_tty_attr;
char m_last_keycode;
int m_vt_qws;
+ int m_originalKbdMode;
};
@@ -150,6 +151,9 @@ QWSTtyKbPrivate::QWSTtyKbPrivate(QWSTtyKeyboardHandler *h, const QString &device
tcgetattr(m_tty_fd, &termdata);
#if defined(Q_OS_LINUX)
+ // record the original mode so we can restore it again in the constructor
+ ::ioctl(m_tty_fd, KDGKBMODE, m_originalKbdMode);
+
// PLEASE NOTE:
// The tty keycode interface can only report keycodes 0x01 .. 0x7f
// KEY_MAX is however defined to 0x1ff. In practice this is sufficient
@@ -206,10 +210,9 @@ QWSTtyKbPrivate::~QWSTtyKbPrivate()
{
if (m_tty_fd >= 0) {
#if defined(Q_OS_LINUX)
- ::ioctl(m_tty_fd, KDSKBMODE, K_XLATE);
+ ::ioctl(kbdFD, KDSKBMODE, m_originalKbdMode);
#endif
tcsetattr(m_tty_fd, TCSANOW, &m_tty_attr);
- QT_CLOSE(m_tty_fd);
}
}