fix add to favs
[enigma2.git] / keymapparser.py
index 11c8530..23cd5a8 100644 (file)
@@ -3,6 +3,9 @@ import enigma
 
 from keyids import KEYIDS;
 
+# these are only informational (for help)...
+from Tools.KeyBindings import addKeyBinding
+
 def readKeymap():
 
        p = enigma.eActionMapPtr()
@@ -14,8 +17,10 @@ def readKeymap():
                
        try:
                source = open(filename1)
+               filename = filename1
        except:
                source = open(filename2)
+               filename = filename2
 #              raise "couldn't open keymap.xml!"
        
        try:
@@ -44,7 +49,7 @@ def readKeymap():
                                
 #                              try:
                                flags = sum(map(flag_ascii_to_id, flags))
-                               print "-> " + str(flags)
+#                              print "-> " + str(flags)
 #                              except:
 #                                      raise str("%s: illegal flags '%s' specificed in context %s, id '%s'" % (filename, flags, context, id))
                                
@@ -67,8 +72,9 @@ def readKeymap():
                                        except:
                                                raise "key id '" + str(id) + "' is illegal"
 
-                               print context + "::" + mapto + " -> " + device + "." + hex(keyid)
+#                              print context + "::" + mapto + " -> " + device + "." + hex(keyid)
                                p.bindKey(device, keyid, flags, context, mapto)
+                               addKeyBinding(keyid, context, mapto)
                
                parseKeys("generic", cmap)