2008/8/23 Peter Hartlich <[EMAIL PROTECTED]>:
>> Well no, I thought about this, and found another solution, see updated
>> grabkeys() for my preferred solution.
> It will initialize modifiers[] in all 7 iterations of the for loop
> though. And grabkeys() still does the work grabbuttons() subtly relies
> on later...
grabbuttons() depends on it yes, though otherwise grabkeys() would
depend on initmodmap() which could be considered similiar subtle ;) My
current favorit is something like:
unsigned int getnumlockmask(void);
which replaces the global numlockmask. Thus, we would do something like:
unsigned int numlockmask = getnumlockmask();
unsigned int modifiers[] = { 0, LockMask, numlockmask, numlockmask|LockMask };
in grabbuttons and grabkeys, then all subtle stuff is gone imho.
What do you think?
Kind regards,
--Anselm