[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: taking over global key events (X, NS, W32)

From: joakim
Subject: Re: taking over global key events (X, NS, W32)
Date: Mon, 13 Jun 2011 20:41:44 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Ted Zlatanov <address@hidden> writes:

> On Tue, 24 May 2011 20:05:28 -0500 Ted Zlatanov <address@hidden> wrote: 
> TZ> I think GNU Emacs, at least on GNU/Linux systems, can provide much of
> TZ> the desktop environment functionality, so Emacs + a window manager like
> TZ> XMonad is a full desktop experience
> ...
> TZ> I'd like to know how much of this can be achieved with today's GNU Emacs
> TZ> plus the external packages (GNU ELPA, Tom Tromey's ELPA, EmacsWiki,
> TZ> etc.) available, and how much will require new packages or changes to
> TZ> Emacs' internals.
> Can Emacs register to handle some global key events in the X, NS, and
> W32 environments, for when it doesn't have the keyboard focus?

I'm also interested in this for my Inkmacs project. The easiest way so
far was using the DBus bindings to catch the multimedia keys, which is a
bit limited. I also tried using the Gnome hotkeys to bind it to a
dispatcher, but that was so far not successful in Gnome 3 although it
used to sort of work in earlier Gnomes.

Here's some dbus code. (BTW Emacs dbus support is great!)

(provide 'emms-dbus)
(require 'dbus)

(defun emms-dbus-signal-handler (msg1 signal-name)
  (message "emms-dbus-signal-handler %s %s" msg1 signal-name)
  ;Play Stop Next Previous
   ((equal "Next" signal-name)
   ((equal "Previous" signal-name)
   ((equal "Stop" signal-name)
   ((equal "Play" signal-name)

 :session ;bus
 nil; "org.gnome.SettingsDaemon.MediaKeys" ;service
 nil; "/org/gnome/SettingsDaemon/MediaKeys" ;path
 "org.gnome.SettingsDaemon.MediaKeys" ;interface
 "MediaPlayerKeyPressed" ;signal
 'emms-dbus-signal-handler ;handler

> Thanks
> Ted

Joakim Verona

reply via email to

[Prev in Thread] Current Thread [Next in Thread]