Thanks!

so I just try quickly something like this. Exactly what i need.

auto mouse = Gtk::GestureClick::create();
mouse->set_propagation_phase(Gtk::PropagationPhase::CAPTURE);
mouse->set_button(GDK_BUTTON_PRIMARY);
add_controller(mouse);
mouse->signal_pressed().connect(sigc::mem_fun(*this, &Window::
on_mouse_key_pressed), false);

void on_mouse_key_pressed(int, double, double)
{
std::cout << "clic left mouse button" << std::endl;
}

Le lun. 26 sept. 2022 à 19:29, Andrew Potter <agpot...@gmail.com> a écrit :

>
> On Mon, Sep 26, 2022 at 10:17 AM Duncan Duncan via gtkmm-list <
> gtkmm-list@gnome.org> wrote:
>
>> Could someone explain how to get  event key mouse ?
>>
>>
> Hi,
> A question on the list a couple months ago prompted me to make this github
> gist:
>
> https://gist.github.com/talisein/f4f80167fa21f329f3db06a2730746f5
>
> In short, you need a Gtk::GestureClick event controller. The current gtkmm
> documentation is at
> https://gnome.pages.gitlab.gnome.org/gtkmm/classGtk_1_1GestureClick.html
>
> Unfortunately google doesn't like returning the gitlab pages links yet.
>
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list

Reply via email to