[mythtv] customizable keys

Jared Verdi jnverdi at optonline.net
Mon Jun 30 00:37:59 EDT 2003

I would very much like to see this implemented.  My remote has similar

-----Original Message-----
From: mythtv-dev-bounces at snowman.net
[mailto:mythtv-dev-bounces at snowman.net] On Behalf Of Mailing Lists
Sent: Sunday, June 29, 2003 8:30 PM
To: mythtv-dev at snowman.net
Subject: [mythtv] customizable keys

I have started looking into configurable keys, and I have an approach I 
think will work, but I wanted to get some feedback before I invested a 
great deal of time into it.  BTW: this is just pseudocode, so please
reply correcting my syntax ;-)

#include <Qmap.h>
#include <Qstring.h>

class keymap {

   Qmap<Qstring, int> map;

   keymap() {
   map["Up"] = Qt::Key_Up;
   map["Down"] = Qt::Key_Down;
   map["Left"] = Qt::Key_Left;
   map["Right"] = Qt::Key_Right;
   map["+"] = Qt::Key_Plus;

   int get(Qstring keyname) { return map[keyname]; }

class translate {

   Qmap<Qstring, Qstring> map;
   keymap k_map;

     bool read_from_db(void) {
         read the keyboard config from the database, into map.
         format (Function, Key) ie ("EPG Up", "Up") or ("TV CH+", "+")

         // I have a remote control where the up button doubles as
down doubles as stop, etc,
         // so I would like to see different keydefs for each mode (EPG,

TV, Weather, etc)
         // that way the system will be fully customizable
     int translate(Qstring k) {
         return k_map.get(map[k]);


so you would just call translate::translate("Keyname") where ever you
collecting keypresses.

I would appreciate any comments,


mythtv-dev mailing list
mythtv-dev at snowman.net

More information about the mythtv-dev mailing list