fix flags
[enigma2.git] / lib / driver / rc.h
index 7b73596244b602fa46e8c87d778e39f07cbfa4c4..909ebaee706ff5c831612ea469c343be8a4fbd56 100644 (file)
@@ -12,6 +12,8 @@ class eRCInput;
 class eRCDriver;
 class eRCKey;
 
+#ifndef SWIG
+
 /**
  * \brief A remote control.
  *
@@ -124,10 +126,15 @@ public:
        }
        enum
        {
+                       /* there are not really flags.. */
+               flagMake=0,
                flagBreak=1,
-               flagRepeat=2
+               flagRepeat=2,
+               flagLong=3,
+                       /* but this is. */
+               flagAscii=4,
        };
-       
+
        bool operator<(const eRCKey &r) const
        {
                if (r.producer == producer)
@@ -161,12 +168,19 @@ public:
                rrate;          // repeat rate (in ms)
 };
 
+#endif
+
 class eRCInput: public Object
 {
        int locked;     
        int handle;
        static eRCInput *instance;
-
+       int keyboardMode;
+#ifdef SWIG
+       eRCInput();
+       ~eRCInput();
+public:
+#else
 public:
        struct lstr
        {
@@ -181,15 +195,32 @@ public:
        Signal1<void, const eRCKey&> keyEvent;
        eRCInput();
        ~eRCInput();
-       
-       int lock();
-       void unlock();
-       int islocked() { return locked; }
+
        void close();
        bool open();
 
        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.
+       */
+
        void keyPressed(const eRCKey &key)
        {
                /*emit*/ keyEvent(key);
@@ -199,10 +230,16 @@ public:
        void removeDevice(const std::string &id);
        eRCDevice *getDevice(const std::string &id);
        std::map<std::string,eRCDevice*,lstr> &getDevices();
-       
-       static eRCInput *getInstance() { return instance; }
-       
+
        eRCConfig config;
+#endif
+       enum { kmNone, kmAscii, kmAll };
+       void setKeyboardMode(int mode) { keyboardMode = mode; }
+       int  getKeyboardMode() { return keyboardMode; }
+       static eRCInput *getInstance() { return instance; }
+       int lock();
+       void unlock();
+       int islocked() { return locked; }
 };
 
 #endif