Skip to content

Cursor focus tracking using QAccessible

Tuesday, 20 July 2010  |  dipesh

KMag used to zoom into part of the screen got just today an additional mode: Follow Focus Mode. That means that kmag can now follow either the mouse pointer or the keyboard cursor.

Video of KMag with 'Follow Focus' mode

Extending for example KWin's full-screen zoom plugin can be done with something like;

QDBusConnection::sessionBus().connect("org.kde.kaccessibleapp",
    "/Adaptor", "org.kde.kaccessibleapp.Adaptor", "focusChanged",
    this, SLOT(focusChanged(int,int)));

This is work in progress and only works with Qt and KDE applications. Adding support for others shouldn't be that difficult with qtatspi. To try out checkout kdeaccessibility from SVN trunk (>=r1152354) and;

export QT_ACCESSIBILITY=1
kmag