Re: [PATCH to panel] popup menu and "run" dialog independant of the state of ScrollLock and NumLock



On 27 Feb 2001, Havoc Pennington wrote:

> 
> Vlad Harchev <hvv hippo ru> writes:
> > +	
> > +	ignored_mods = ~(GDK_LOCK_MASK /*capslock*/ | GDK_MOD2_MASK /*numlk*/ | 
> > +		GDK_MOD5_MASK /*scrolllock*/| 0x2000 /*Xkb modifier*/);
> 
> That isn't right, there's no guarantee or even likelihood that MOD2
> and MOD5 will have those mappings. They might be used for
> super/hyper/etc. which would be legitimate keys to use for the
> keybinding.

 Hm, that complicates stuff a lot. 

> Instead of ignoring some mods, the patch should see if the expected
> mods are set. i.e. if ((keypress_state & binding_mods) == binding_mods).

 I just tried to really work with a patched panel. If "Run.." dialog is
invokable via Ximian's "Ctrl-Mod4-r", then I CAN NOT TYPE "r" in any widget of
any window! ( use safwish as wm, and when I press 'r', the window it's typed
in quivers. It appears this is how X works :( So, don't apply this patch yet -
it breaks things.

 So, to work around this X's limitation, we can grab all possible combinations
of "uninteresting" modifiers (combined with a fixed value for combination of
"interesting"), and the fewer uninteresting combinations we
have, the better (i.e. it's our intereset to not support supersets of
"meaningful" modifiers - i.e. if the original binding is "ctrl-alt-r", it
shouldn't be activated if "ctrl-alt-super-r" is pressed IMO). But with this
approach there is still a need to know which modifiers are not meaningful
(which ones correspond to keys treated as numlock and scrolllock). I think
that we should hardcode typical values a usual 105-key keyboard has, and check
some environment variable for a mask containing all "not meaningful
modifiers" - if it's defined, then use its value as a bitset of "not
meaningful" modifiers.

 What do you think?

> Havoc
> 

 Best regards,
  -Vlad





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]