Skip to content

Commit

Permalink
#567 when checking to see if the modifier is ignored, pass both the m…
Browse files Browse the repository at this point in the history
…odifier name (ie: control) and the keynames: motion events use the former (to ignore control), key events use the latter (to ignore a specific key press, ie: "Control_L")

git-svn-id: https://xpra.org/svn/Xpra/trunk@6549 3bb7dfac-3a0b-4e04-842a-767bc560f471
  • Loading branch information
totaam committed May 24, 2014
1 parent f58aa3b commit 044b144
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions src/xpra/x11/server_keyboard_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,16 +335,18 @@ def make_keymask_match(self, modifier_list, ignored_modifier_keycode=None, ignor
log("make_keymask_match: ignored as keynames_for_mod not assigned yet")
return
if ignored_modifier_keynames is None:
ignored_modifier_keynames = self.xkbmap_mod_pointermissing

def is_ignored(modifier_keynames):
if not ignored_modifier_keynames:
return False
for imk in ignored_modifier_keynames:
if imk in modifier_keynames:
log("modifier ignored (ignored keyname=%s)", imk)
return True
return False
#this is not a keyboard event, ignore modifiers in "mod_pointermissing"
def is_ignored(modifier, modifier_keynames):
m = modifier in self.xkbmap_mod_pointermissing
log("is_ignored(%s, %s)=%s", modifier, modifier_keynames, m)
return m
else:
#keyboard event: ignore the keynames specified
#(usually the modifier key being pressed/unpressed)
def is_ignored(modifier, modifier_keynames):
m = set(modifier_keynames) & set(ignored_modifier_keynames)
log("is_ignored(%s, %s)=%s", modifier, modifier_keynames, m)
return bool(m)

current = set(self.get_current_mask())
wanted = set(modifier_list)
Expand All @@ -361,7 +363,7 @@ def change_mask(modifiers, press, info):
if not keynames:
log.error("unknown modifier: %s", modifier)
continue
if is_ignored(keynames):
if is_ignored(modifier, keynames):
log("modifier %s ignored (in ignored keynames=%s)", modifier, keynames)
continue
#find the keycodes that match the keynames for this modifier
Expand Down

0 comments on commit 044b144

Please sign in to comment.