Keybinder - Perl extension that wraps libkeybinder for GTK apps
use Keybinder; bind_key('<Ctrl>B' => sub{ ... }); bind_key('<Shift>F1' => sub{ ... }); bind_key('<Ctrl><Alt>V' => sub{ ... }); unbind_key('<Ctrl>B');
Gtk2 toolkit is great, but it does not provides "global" hotkeys availability, i.e. catching some accelerator press event while current window is not active. libkeybinder has been developed to fill that gap.
The current bindings aren't complete, but enough for my purposes.
The accelerator representatic string should be accepted by gtk_accelerator_parse. Here is an extraction:
The format looks like "<Control>a" or "<Shift><Alt>F1" or "<Release>z" (the last one is for key release). The parser is fairly liberal and allows lower or upper case, and also abbreviations such as "<Ctl>" and "<Ctrl>".
bind_key, unbind_key
https://github.com/engla/keybinder, https://developer.gnome.org/gtk3/
Ivan Baidakou (a.k.a. basiliscos) <dmol@(cpan.org)>
Copyright (C) 2013 by Ivan Baidakou
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.16.3 or, at your option, any later version of Perl 5 you may have available.
To install Keybinder, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Keybinder
CPAN shell
perl -MCPAN -e shell install Keybinder
For more information on module installation, please visit the detailed CPAN module installation guide.