small changes
[enigma2.git] / lib / driver / rc.h
index 8d932f8e6f5a7057538b5fb03aca75b6f5a70aff..1ce13c7241da2199c7f8f643fa10af2e637f49b7 100644 (file)
@@ -51,15 +51,6 @@ public:
         * \param key The key to get the description for.
         * \result User readable description of given key.
         */
-       virtual const char *getKeyDescription(const eRCKey &key) const=0;
-       /**
-        * \brief Get a dbox2-compatible keycode.
-        *
-        * THIS IS DEPRECATED! DON'T USE IT UNLESS YOU NEED IT!
-        * \param key The key to get the compatible code for.
-        * \result The dbox2-compatible code. (new RC as defined in enum).
-        */
-       virtual int getKeyCompatibleCode(const eRCKey &key) const;
 };
 
 /**
@@ -175,6 +166,7 @@ class eRCInput: public Object
        int locked;     
        int handle;
        static eRCInput *instance;
+       int keyboardMode;
 
 public:
        struct lstr
@@ -188,15 +180,6 @@ protected:
        std::map<std::string,eRCDevice*,lstr> devices;
 public:
        Signal1<void, const eRCKey&> keyEvent;
-       enum
-       {
-               RC_0=0, RC_1=0x1, RC_2=0x2, RC_3=0x3, RC_4=0x4, RC_5=0x5, RC_6=0x6, RC_7=0x7,
-               RC_8=0x8, RC_9=0x9,
-               RC_RIGHT=10, RC_LEFT=11, RC_UP=12, RC_DOWN=13, RC_OK=14, RC_MUTE=15,
-               RC_STANDBY=16, RC_GREEN=17, RC_YELLOW=18, RC_RED=19, RC_BLUE=20, RC_PLUS=21, RC_MINUS=22,
-               RC_HELP=23, RC_DBOX=24,
-               RC_UP_LEFT=27, RC_UP_RIGHT=28, RC_DOWN_LEFT=29, RC_DOWN_RIGHT=30, RC_HOME=31
-       };
        eRCInput();
        ~eRCInput();
        
@@ -208,6 +191,30 @@ public:
 
        void setFile(int handle);
 
+       /* This is only relevant for "keyboard"-styled input devices,
+          i.e. not plain remote controls. It's up to the input device
+          driver to decide wheter an input device is a keyboard or
+          not.
+          
+          kmNone will ignore all Ascii Characters sent from the 
+          keyboard/console driver, only give normal keycodes to the
+          application.
+          
+          kmAscii will filter out all keys which produce ascii characters,
+          and send them instead. Note that Modifiers like shift will still
+          be send. Control keys which produce escape codes are send using
+          normal keycodes. 
+          
+          kmAll will ignore all keycodes, and send everything as ascii,
+          including escape codes. Pretty much useless, since you should
+          lock the console and pass this as the console fd for making the
+          tc* stuff working.
+       */
+       
+       enum { kmNone, kmAscii, kmAll };
+       void setKeyboardMode(int mode) { keyboardMode = mode; }
+       int  getKeyboardMode() { return keyboardMode; }
+
        void keyPressed(const eRCKey &key)
        {
                /*emit*/ keyEvent(key);