How to set focus to another application?

Lubos Lunak l.lunak at suse.cz
Tue Sep 30 17:03:47 BST 2003


On Tuesday 30 of September 2003 17:47, \\\ wrote:
> Quoting Lubos Lunak <l.lunak at suse.cz>:
> > usually the right choice. However, are you sure the visual keyboard
> > should really work that way? I cannot really check, because I don't know
> > the source (was that [1] meant to mention URL later?). Wouldn't it be for
> > example better if the visual keyboard was a non-focusable window, that
> > would simply feed the faked keypresses to whichever window is active?
> > Which with XTest would just mean generating the events, as you don't need
> > to target those, they'll go to the focused window. The user would then
> > normally change active windows as usually.
>
> Yes, the [1] was meant to point out that this is a nascent application
> that's not yet ready to go into kdenonbeta, but I'll put a the
> source/binary on an FTP site a bit later.
>
> But I don't understand the comment about a non-focusable window - forgive
> my ignorance, but how would one click on the keys in Viki if it did not
> have focus?

 Window has focus = window is active, and receives keyboard events. But you 
can of course click even on windows that are not active, as long as they're 
visible. For example see KPager (but please don't copy the focus disabling 
code from it, at least not as the final version - it kind of works, but it's 
not right; I'm trying to find a better way).

-- 
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