App::Chart::Gtk2::Ex::BindingBits -- helpers for Gtk2::BindingSet etc
Activate bindings for a button press
$event. The return is true if a binding was found and activated or false if not.
$eventshould be a
Gtk2::Gdk::Event::Button. The button number is turned into keyval
Pointer_Button1etc, modifiers get
release-maskadded if it's a
button-releaseevent, then simply
$bindings->activate ($keyval, $modifiers, $object)
$bindingscan be either a
Gtk2::BindingSetobject or a string name of a binding set for
Gtk2::BindingSet->find. As of Gtk 2.18 there's keyvals for buttons 1 through 5. If
$event->buttonis somehow another value then
activate_button_eventreturns 0 as there cannot be any bindings for it.
See examples/binding-button-event.pl in the sources for a sample program.
For reference, as of Gtk 2.18 the
$object->bindings_activate is no good for
Pointer_Button1 etc as that
bindings_activate trys to go from keyval to hardware keycode then back to keyvals, but there's normally no keycode for the pointer buttons, so it doesn't lookup anything in the BindingSet.
Copyright 2009, 2010 Kevin Ryde
Chart is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Chart is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Chart. If not, see http://www.gnu.org/licenses/.