API for binding and unbinding a key combo?
Thiago Macieira
thiago at kde.org
Thu Mar 27 12:16:23 PDT 2008
Bastien Nocera wrote:
>On Thu, 2008-03-27 at 15:19 +1100, Justin Clift wrote:
>> Hi all,
>>
>> I'm looking for a "works across all window managers" way of setting a
>> Control-Printscreen key binding in my (Glib/GTK based) application.
>>
>> Any suggestions?
>
>This is how to do it for GNOME:
>http://live.gnome.org/ControlCenter/CustomKeybindings
>
>If you want to use the application defined keybindings, see:
>http://live.gnome.org/ControlCenter/ApplicationDefinedKeybindings
>
>The problem with the latter is that you still need your application to
>be running, and the keys to be grabbed by the application using
>XGrabKey.
KDE 4 now has a centralised global shortcut management system. The reasons
for doing that are because:
- information is persistent: you're notified of a conflict even if the
other app isn't running or even if it has never been run
- XGrabKey is, per definition, platform (X11) specific, but I have no
idea if our solution has been ported to other platforms
- support for complex key combinations, especially prefixes (à la Emacs),
though hopefully no one will use that
- get rid of the problem that "the shortcut doesn't work and no one knows
why" because another application has grabbed it and you don't know which
(or it sometimes work, sometimes it doesn't, depending on the order in
which you started the apps)
Drawbacks are increased complexity and Single Point of Failure (kded
crashes → all global shortcuts lost).
This API is accessible via D-Bus. If wanted, we could work on making it an
fd.o spec.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
PGP/GPG: 0x6EF45358; fingerprint:
E067 918B B660 DBD1 105C 966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/xdg/attachments/20080327/17ca2caf/attachment.pgp
More information about the xdg
mailing list