Bind key to clearFocus in konqueror
Eduardo Robles Elvira
edulix at gmail.com
Mon Aug 2 22:48:57 BST 2010
On Mon, Aug 2, 2010 at 5:33 AM, Daniel Bolton
<danielbarrettbolton at gmail.com> wrote:
> I am posting to the kfm-devel list but not subscribed to it.
>
> What I want to do bind a key in Konqueror to focus out-- i.e. take focus
> away from the selected widget, but not give focus to a new one. This is apropos
> a brainstorm I posted on the KDE forum [1]. Right now, it seems that the only
> way to do this is to click on something in the window that is not a widget,
> like a 'blank' area of a webpage. I believe the Q widget function that this
> involves is clearFocus [2].
>
> I have looked over and grepped through Konqueror's source code for an hour or
> so, and I have seen plenty of functions that involve giving focus to a widget
> ( e.g. KonqMainWindow::focusLocationBar ), but none that describe taking it
> away. My guess is that this is some generic functionality defined outside
> Konqueror's source, but perhaps it would be possible to add a function to
> take care of this somewhere and bind a key to it.
>
> If anyone can provide further information on this topic, I would
> appreciate it.
>
> Thanks,
> Daniel
>
> 1 - http://forum.kde.org/brainstorm.php?sid=5794bec2e6139c2845a432338cb4dc59#idea88581_page1
> 2 - http://doc.trolltech.com/4.1/qwidget.html#clearFocus
This can be easily done (by code) writing an action that triggers this
code: if(qApp->focusWidget()) { qApp->focusWidget()->clearFocus(); }
Probably this can be done with a konqueror plugin, but I don't
remember exactly how do they work. Plugins probably can register
actions (which can be assigned shortcuts) so that would be it. You
could then connect the action to a slot that contains the code above.
I like the idea of using applications with the keyboard. When I get
time, I would like to improve the way khtml lets me click in links
using "Ctrl" key which adds a key shortcut for each link, because when
it runs out of letters/numbers it stops adding shortcuts. It should
instead only add shortcuts for links currently visible. Also it fails
in some webpages (like slashdot) by repeating the same shortcut for
different links..
I think in KDE we should try to improve the usability of our
applications with these kind of things. Thanksfully it seems some
people (those working on the simon project for example) are working
towards that.
Greetings,
Eduardo
More information about the kfm-devel
mailing list