[Mono-dev] Catch keys outside the Window?

Michael Hutchinson m.j.hutchinson at gmail.com
Sat Jun 28 13:22:43 EDT 2008


On Tue, Jun 24, 2008 at 6:48 PM, Xeon06 <alex.turpin at gmail.com> wrote:
>
> Hey all,
>
> I'm trying to make a keybinding application in C# using Mono. However, I
> have no experience whatsoever in programming under Linux (more specifically
> I'm under Ubuntu and GNOME). I need to be able to detect keypresses outside
> the window of my application. I also want the application to be in the tray
> (left of the clock, however thats called in Linux). In Windows I would just
> hook the user32.dll but under Linux I am well... Stuck. Is there something
> in the Mono library that allows this? Or can I "hook" some Linux binary? I
> read a bit and I'd need to use the X server but I'm not even sure if I can
> do this with Mono.

You may find this useful:
http://svn.gnome.org/viewvc/tomboy/trunk/Tomboy/XKeybinder.cs?view=markup

According to the COPYING file, the license seems to be LGPL, so you
won't have to worry about the license as long as you keep it in a
separate library.

Note that it's P/Invoking libtomboy
(http://svn.gnome.org/viewvc/tomboy/trunk/libtomboy/) so you'd need to
use that too.

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Mono-devel-list mailing list