Beispiel #1
0
    def unregister_hotkeys():
        for mapping in Config.KEYMAP:
            callback = Config.KEYMAP[mapping]

            codes = mapping.split('-')
            mods = codes[:-1]
            key = codes[-1]

            # No key?
            if not key:
                print >> sys.stderr, "Could not map %s to %s" % (mapping,
                                                                 callback)
                continue

            # generate key code and mod mask...
            keycode = PROBE.generate_keycode(key)
            modmask = PROBE.generate_modmask(mods)

            # Tell X we want to hear about it when this key is pressed...
            try:
                PROBE.ungrab_key(keycode, modmask)
            except:
                print "Nada:", callback

        # And finally reset the dispatcher...
        State._DISPATCHER = {}
Beispiel #2
0
 def unregister_hotkeys():
     for mapping in Config.KEYMAP:
         callback = Config.KEYMAP[mapping]
         
         codes = mapping.split('-')
         mods = codes[:-1]
         key = codes[-1]
         
         # No key?
         if not key:
             print >> sys.stderr, "Could not map %s to %s" % (mapping, callback) 
             continue
         
         # generate key code and mod mask...
         keycode = PROBE.generate_keycode(key)
         modmask = PROBE.generate_modmask(mods)
         
         # Tell X we want to hear about it when this key is pressed...
         try:
             PROBE.ungrab_key(keycode, modmask)
         except:
             print "Nada:", callback
         
     # And finally reset the dispatcher...
     State._DISPATCHER = {}