[mythtv-commits] Ticket #10053: MythUI KeyBinding reworked

MythTV noreply at mythtv.org
Tue Oct 18 20:11:37 UTC 2011


#10053: MythUI KeyBinding reworked
-------------------------------------------------+-------------------------
 Reporter:  Xavier Hervy <xavier.hervy@…>        |          Owner:  stuartm
     Type:  Patch - Feature                      |         Status:  new
 Priority:  minor                                |      Milestone:  unknown
Component:  MythTV - User Interface Library      |        Version:
 Severity:  medium                               |  Unspecified
 Keywords:  mythui lirc                          |     Resolution:
                                                 |  Ticket locked:  0
-------------------------------------------------+-------------------------

Comment (by Xavier Hervy <xavier.hervy@…>):

 I upload a much simpler design in mythinputevent-2011-10-18.diff:
 It does not create plugin for input see #10069 for that.
 In this version, mythcontrol is not included as I did not finish yet (been
 busy with frontend setup) and the diff file have been edited by hand to
 remove all the changes which are not relevant to this patch. In an other
 word I will do a correct patch when it will be all done.
 In the meantime, comment are welcome.

 This patch add a new class called MythInputEvent, this class inherit from
 QKeyEvent for backward compatibility, which mean I did not need to modify
 every keyPressEvent(QKeyEvent *e) for each UI class.

 The MythInputEvent add three new accessors inputName, remoteName and
 buttonName

 When the method TranslateKeyPress is called, if the QKeyEvent is a
 MythInputEvent, a new method is called instead:
 TranslateKeyPress(const QString &context,
                   MythInputEvent *e, QStringList &actions,
                   bool allowJumps)

 This method is responsible to translate a MythInputEvent to an action list
 in a similar fashion as QKeyEvent is translated into actions
 If this called failed, the previous method is use instead. (backward
 compatibility)

 The inputName (say lirc), the remoteName (PVR-150) and Button name (Play)
 are save in the keybindings and jumppoint tables therefor 3 new fields
 ahve been create in those.

 As an exemple and test, I modified lirc.cpp to produce MythInputEvent
 instead of MythLircKeyCodeEvent in two configurations:
 * When the lirc key is not translatable to QKeyEvent
 * when the .lircrc have not been found

-- 
Ticket URL: <http://code.mythtv.org/trac/ticket/10053#comment:1>
MythTV <http://code.mythtv.org/trac>
MythTV Media Center


More information about the mythtv-commits mailing list