[mythtv-commits] Ticket #409: Support for modifier keys from lirc
MythTV
mythtv at cvs.mythtv.org
Sun Oct 2 19:14:06 UTC 2005
#409: Support for modifier keys from lirc
-------------------------------+--------------------------------------------
Reporter: mythtv at hburch.com | Owner: ijr
Type: defect | Status: new
Priority: minor | Milestone:
Component: mythtv | Version: 0.18.1
Severity: medium | -------------------------------+--------------------------------------------
Under a newly built mythtv (0.18.1-1 from Gentoo), modifier keys are
ignored. A look at libs/libmyth/mythdialogs.cpp shows that mod is defined
as k & MODIFIER_KEYS. MODIFIER_KEYS is #defined as 0x00f0000. The result
is passed to QKeyEvent as "state", which is apparently stored as a SHORT,
killing any bits that were set.
As a result, saying that "Play" should be "Ctrl+P" results in tv_play
getting a QKeyEvent of "P" with state = 0.
Before I propose my fix, let me point out that I'm not familiar with what
UNICODE_ACCEL means. That said, here's my proposed patch, which converts
the MODIFIER_KEY bits into the Qt namespace, which is apparently what
MythMainWindowPrivate::TranslateKeyNum expects anyway. This may be an
appropriate thing to do in any case.
{{{
--- libs/libmyth/mythdialogs.cpp 2005-04-01 15:18:40.000000000
-0500
+++ ../../mythtv-0.18.1/libs/libmyth/mythdialogs.cpp 2005-10-02
10:25:34.000000000 -0400
@@ -733,6 +799,13 @@
QChar c(k & ~UNICODE_ACCEL);
ascii = c.latin1();
text = QString(c);
+
+ int m = 0;
+ if (mod & CTRL) m |= Qt::ControlButton;
+ if (mod & SHIFT) m |= Qt::ShiftButton;
+ if (mod & ALT) m |= Qt::AltButton;
+ if (mod & META) m |= Qt::MetaButton;
+ mod = m;
}
QKeyEvent key(lke->isKeyDown() ? QEvent::KeyPress :
}}}
--
Ticket URL: <http://cvs.mythtv.org/trac/ticket/409>
MythTV <http://www.mythtv.org/>
MythTV
More information about the mythtv-commits
mailing list