[mythtv] [Patch] enables keymodiers

Gerald Gryschuk gerald.gryschuk at shaw.ca
Sun Jan 11 18:42:53 EST 2004


Hi.

I'm attaching a patch which updates the mythtv keycode handing to
actually use the keymodifiers. The fact this wasn't working first dawned
on me when I tried using the keybindings in the 'jumppoints' table.

The basic problem seems to be that it was assumed that the 'keynum' from
QKeyEvent was the same as was created by 'QKeySequence' when in fact it
isn't. So my patch basically translates the keynum from QKeyEvent to the
keynum produced by QKeySequence. It only does this if the current key
isn't the Escape key or one of the modifier keys themselves. I left the
Escape key out of the processing for now since this is generally used
for backing out to higher menus and even to exit mythfronted. In the
latter case the current code actually tests for a modifier key in
ThemedMenu::keyPressEvent. I didn't want to take the chance of breaking
that code before I understood it better.

So to reiterate, this patch changes the keynum in
MythMainWindow::TranslateKeyPress so that it is the same as the keynum
produced by QKeySequence. If no modifier keys are currently active(up to
four can be active/pressed - see the QKeySequence docs) than the keynum
won't change and you will have the same behaviour as we have now. If
your pressing a modifier key 'Ctrl,Alt,Shift,Meta' than keynum will
change and will be equal to the value produced by QKeySequence. If you
look at the code for RegisterJump and RegisterKey in mythdialogs.cpp
this is exactly what is needed to make modifier keys work.

Since I don't know the preferences of the maintainer (or others) yet I
have included the patch both as a straight diff(keymodifier.patch) and
as a 'cvs diff' patch(keymodifer.rcspatch). Please let me know which is
preferred for future reference.

-- 
Gerald Gryschuk <gerald.gryschuk at shaw.ca>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keymodifier.patch
Type: text/x-patch
Size: 2336 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20040111/d0102912/keymodifier.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: keymodifier.rcspatch
Type: text/x-patch
Size: 1851 bytes
Desc: not available
Url : http://mythtv.org/pipermail/mythtv-dev/attachments/20040111/d0102912/keymodifier-0001.bin


More information about the mythtv-dev mailing list