Opened 19 years ago
Closed 19 years ago
#409 closed defect (invalid)
Support for modifier keys from lirc
Reported by: | Owned by: | Isaac Richards | |
---|---|---|---|
Priority: | minor | Milestone: | unknown |
Component: | mythtv | Version: | 0.18.1 |
Severity: | medium | Keywords: | lirc |
Cc: | Ticket locked: | no |
Description
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 :
Change History (2)
comment:1 Changed 19 years ago by
comment:2 Changed 19 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
Not certain how I missed that, but, yes, I see effectively my proposed "fix" is in trunk (outside UNICODE_ACCEL).
I did check, but checked wrong. I am happily surprised to see that I did almost exactly the right thing.
Sorry for the dupe.
Pretty certain this was fixed in SVN months back. 0.18 is nearly six months old!!