[Gtk-sharp-list] Grabbing a specific-key globally

Alex Graveley alex at beatniksoftware.com
Mon Aug 1 12:17:18 EDT 2005


Ya, check out tomboy/libtomboy/tomboy-keybinder.c for the low-level X 
code, and tomboy/Tomboy/XKeybinder.cs for the C# binding.

This code is of course philosophically broken and evil, but there is no 
better way currently.

-Alex

Miguel de Icaza wrote:
> Hello,
> 
> 
>>I want my application to perform a certain action when a certain key is
>> pressed, no matter if the application is currently focused or not. The
>> actual thing I want to do is to assign a shortcut key for certain
>> forms in my application, so it is very possible that no form of the
>> application is focused (or visible, for that manner) when the shortcut
>> key is pressed. I would like to be able to define the key and its
>> modifiers. The way I see it, is that there should be a way to assign a
>> delegate to a key using some kind of a "GrabKey" method, perhaps part
>> of gdk, that receives the key, the modifiers, the lock-level (global
>> or application-only) and the delegate. However, I did not find any
>> method like that.
> 
> 
> Look at the source code for Tomboy, it does that.
> 
> Miguel.
> _______________________________________________
> Gtk-sharp-list maillist  -  Gtk-sharp-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/gtk-sharp-list



More information about the Gtk-sharp-list mailing list