Pressing and releasing the Win-key opens the K-Menu

Lubos Lunak l.lunak at suse.cz
Thu Apr 3 15:50:45 BST 2003


On Thursday 03 of April 2003 00:44, Ellis Whitehead wrote:
> On Tuesday 01 April 2003 15:36, Lubos Lunak wrote:
> > On Monday 31 of March 2003 10:24, Ellis Whitehead wrote:
> > > Hi all,
> > >
> > > I just committed a patch to kdebase/kicker/buttons/kbutton.*, which
> > > opens the K-Menu when the Win-key is pressed and released with no
> > > intervening keys.  It will only work if the Win-keys are assigned
> > > Super_L and/or Super_R, as is standard in XFree 4.x -- the old Meta
> > > assignments won't trigger it.  If anyone has problems or suggestions,
> > > please let me know.
> >
> >  Start KMenuEdit, assign Meta+H to 'Home' entry, apply.
> > #1: Press Meta+H -> nothing happens.
> > #2: Even if it worked, I bet I'd get both Konqueror showing my $HOME dir
> > and Kicker showing the K-Menu.
> > #3: Press Meta and repeatedly hit H - Konqy will be started (random
> > number of times < number of times H was pressed ? )
> > #4: It doesn't work with NumLock pressed.
> >
> >  Some of them could be fixed, but let's go directly to the worst one: #1
> > doesn't work simply since the grab for Meta+H is ignored, because Kicker
> > has the keyboard grabbed as soon as Meta is pressed. XSendEvent() won't
> > trigger the Meta+H grab.
>
> I tried your example and get the same results as you (except that the
> number of times to hit 'H' in #3 is always 2), but do you have any idea why
> this doesn't work?  All of the Win+<key> shortcuts I have assigned to kwin,
> kdesktop, etc., work fine...

 Interesting ... but the question I'm asking is rather why it does work with 
others. [few minutes of testing] It worked for you because you didn't try 
hard enough and were just lucky. Open the kcontrol module for shortcuts, 
change something, and try it. The Klipper shortcuts won't work. KDesktop 
shortcuts (e.g. minicli) won't work. KWin shortcuts work only because it does 
XSelectInput() on root window with KeyPressMask for some reason. If I add 
such XSelectInput() call to KHotKeys, it suddenly works too.

 Nothing strange. As I said, XSendEvent() won't trigger the grab. That 
XSelectInput() makes the application receive the KeyPress event from 
XSendEvent(). Since the grabs are done on the root window, the key events are 
for the root window too. So maybe this could be the right fix^H^H^Hugly hack 
in KGlobalAccel to make it work.

>
> > - using XTestFakeKeyPress() instead of XSendEvent(), which could work,
> > since it will trigger the Meta+H grab.
>
> I'll take this approach.  My hesitation is that I don't know if everybody
> who's compiling KDE has the XTest extension.  Do you know?  Is it a
> standard part of X for Solaris, for example?

 No idea. But if you really want to play with this, I'll just join the others 
asking for making this configurable and off by default. I personally doubt 
you'll manage to make it work flawlessly.

-- 
Lubos Lunak
KDE developer
---------------------------------------------------------------------
SuSE CR, s.r.o.  e-mail: l.lunak at suse.cz , l.lunak at kde.org
Drahobejlova 27  tel: +420 2 9654 2373
190 00 Praha 9   fax: +420 2 9654 2374
Czech Republic   http://www.suse.cz/





More information about the kde-core-devel mailing list