Re: Is there any cross-platform solution for global key binding?



On Wed, Aug 11, 2010 at 6:45 AM, Krzesimir Nowak <qdlacz gmail com> wrote:
On Mon, 2010-08-09 at 11:23 +1000, Tao Wang wrote:
> Any help on this? Thanks.
>
> On Fri, Aug 6, 2010 at 3:45 PM, Tao Wang <dancefire gmail com> wrote:
>         Hi,
>
>         I'm developing an gtkmm application and looking for a solution
>         for global key binding, and since the application is
>         cross-platform, I hope the solution is also cross-platform, at
>         least, it should support, Linux, Windows and Mac OS X.
>
>         The feature I want to have is that whenever the application
>         window is in focus or not, user can press a combination of
>         key, say Ctrl+F9, and the application Window is appeared, or a
>         predefined action is executed.
>
>         I tried to find one, but not so much finding. I found
>         libtomboy, which is not cross-platform and using deprecated
>         libegg. I don't think it should be used for a newly write
>         application.
>
>         Can anyone give me some hints on this? Thanks.
>
>         --
>         Regards
>
>         Tao Wang
>
>

Global keybindings are really messy stuff and not standardized a tiny
bit. It reminds me of problems created by ATI Catalyst Control Center -
they took ctrl+alt+c, so in some cases it was impossible to write a
diacritic (ć), because CCC always popped up instead. If I were you I
would avoid defining a global keybinding.

But anyway maybe use key_snooper in Gtk::Main [1]? I don't know if this
will work, though - I have never used it.

Krzesimir

[1]
http://library.gnome.org/devel/gtkmm/2.20/classGtk_1_1Main.html#ab4c316c0789dfb4ab7926e062196c4e5


Many thanks for your reply. I tried key_snooper, however, it looks like just grab the key binding event before the widget handler, and if the application losts focus, it still gets nothing.

--
Regards

Tao Wang


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