[mythtv] [PLUGIN] Key binding editor (MythControls)

Bruce Markey bjm at lvcm.com
Wed May 4 23:44:37 UTC 2005

Micah F. Galizia wrote:
> On Wed, 2005-04-05 at 18:12 -0400, J. Donavan Stanley wrote:
>>Micah F. Galizia wrote:
>>>Hello all,
>>>I've written a little plugin that allows key bindings to be configured
>>>on the frontend (instead of using mythweb or sql).  I would like it to
>>>be included with the plugins package, so if someone with that kind of
>>>authority can have a look, it would be much appreciated.  Instructions
>>>on building/installing are in the README.
>>Any reason why you decided to implement this as a plugin instead of
>>putting in in the frontend itself?  Also, the keypress handler doesn't
>>deal with meta keys like Ctrl+P for example.  Other than that, it's a
>>great idea.
> Easily enough, this could be put in the frontend.  Not my call.

I've always assumed that the reason for the mythweb interface
was to avoid a catch 22 where you could screw up your keys to a
point where you could not fix it through a frontend interface.
You may want to consider maybe having a 'safe' key bindings command
line flag or something to get out of situations like that.

I actually like the idea of this being a module. One way or the
other it will be a different menu item for the user to select
and having a module makes it optional.

Donavan, while you are looking at way to simplify the user options,
maybe it might be worth considering having an Advanced Options
module so that the pages and pages of the more arcane options
don't need to be in the binaries at all but are still accessible
by installing the module.

> However, as a plugin, it is much less complicated to integrate.  Good
> call on the modifiers.  Will look into it.

The fist thing I noticed is that your bindings may still be returned
by the database in a logical order but I've done many bad things to
my test system and the query result order was nearly random. For
example, I had four "Global"s in the left column where three of
them had one or two items. An ORDER BY fixed it right up =).

--  bjm
-------------- next part --------------
--- ../dist/mythcontrols/mythcontrols/keybindings.cpp	2005-05-04 10:47:48.000000000 -0700
+++ mythcontrols/keybindings.cpp	2005-05-04 13:56:21.000000000 -0700
@@ -179,7 +179,8 @@
 	query.prepare("SELECT context,action,description,keylist "
 		      "FROM keybindings "
-		      "WHERE hostname = :HOSTNAME ;");
+		      "WHERE hostname = :HOSTNAME "
+                      "ORDER BY context,action ;");
 	query.bindValue(":HOSTNAME", hostname);

More information about the mythtv-dev mailing list