Ticket #149: keycode_dont_ignore_level.patch

File keycode_dont_ignore_level.patch, 1.4 KB (added by antoine, 4 years ago)

patch for shifted keys

  • src/xpra/server.py

    ### Eclipse Workspace Patch 1.0
    #P Xpra
     
    492492            keycodes.append(_keycode)
    493493        return  keycodes
    494494
    495     def _keycode(self, keyname, group=0):
     495    def _keycode(self, keyname, group=0, level=0):
    496496        keyval = gtk.gdk.keyval_from_name(keyname)
    497497        entries = self._keymap.get_entries_for_keyval(keyval)
    498         ll = None
    499498        keycode = -1
    500499        if group>=0:
    501500            for _keycode,_group,_level in entries:
    502                 if _group==group and ll is None or _level<ll:
    503                     ll = _level
     501                if _group!=group:
     502                    continue
     503                if keycode==-1 or _level==level:
    504504                    keycode = _keycode
    505505        if keycode>0:
    506506            return  keycode
     
    790790        (_, id, keyname, depressed, modifiers) = packet
    791791        self._make_keymask_match(modifiers)
    792792        self._focus(id)
    793         keycode = self._keycode(keyname)
     793        level = 0
     794        if "shift" in modifiers:
     795            level = 1
     796        keycode = self._keycode(keyname, level=level)
    794797        log.debug("now %spressing keycode=%s, keyname=%s", depressed, keycode, keyname)
    795798        xtest_fake_key(gtk.gdk.display_get_default(), keycode, depressed)
    796799