[mythtv] "New" default keybindings
Michael T. Dean
mtdean at thirdcontact.com
Mon Apr 23 21:49:05 UTC 2007
After [13315] added the PLAY action (as opposed to the current
play/pause toggle) to the Music context for MythMusic, I mentioned to
Stuart Morgan that it would be nice for the action to have the same
default keylist as used for the PLAY action in the TV Playback context
(added by
http://svn.mythtv.org/trac/changeset/4281/trunk/mythtv/libs/libmythtv/tv_play.cpp
, although not specifically mentioned in the commit message). He
agreed, but wanted to ensure that we don't create a conflicting binding,
so I volunteered to write a dbcheck patch that checks for a conflict.
While writing the code (attached), I had two options for handling
situations where users didn't already have a keybinding for the PLAY
action in the Music context. The first was to create one in the dbcheck
update. The second was to allow REG_KEY to do it for me.
However, REG_KEY (specifically, MythMainWindow::RegisterKey()) does not
check for conflicts with existing bindings when adding a new binding to
the DB.
So, I think that leaves us three options for new default keybindings.
The first option would be to modify RegisterKey() to use (and write to
the DB) an empty keylist if a conflict is found for a requested new
binding (i.e. one that is not yet in the DB). The second option is to
make it policy that the users should fix their bindings (after all, we
do log the message, "Key <whatever> is bound to multiple actions in
context <wherever>"). And, the third option is to never add new default
keylists for new bindings (or some combination of 2 and 3--add it and
let users fix it for critical bindings and don't add "nice-to-have"
bindings).
The attached patch may help illustrate the point. Because it relies on
REG_KEY to create new entries, it only checks for conflicts for users
who used MythMusic after [13315], but before the patch was applied (i.e.
those who already have a PLAY action in Music context). Those who never
used one of those "in between" versions would never benefit from the
conflict-checking code. By modifying the patch to explicitly add PLAY
bindings for the Music context to the DB when there is none, we can
benefit from conflict-checking. However, with this approach we would
require a DB update for every new default keylist we want to add without
introducing conflicts.
Would changing RegisterKey() (to do a conflict check and use a blank
keylist if one is found) be a good thing or are we relying on the users
to see the conflict messages and fix their bindings themselves?
Thanks,
Mike
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: mythplugins-mythmusic-CtrlP_for_PLAY_action.patch
Url: http://mythtv.org/pipermail/mythtv-dev/attachments/20070423/6ba3fb0d/attachment.diff
More information about the mythtv-dev
mailing list