Skip to content

Menu button brings up a context menu #33

@vanillajonathan

Description

@vanillajonathan

By pressing the Menu button on the keyboard (located left of the right Ctrl key) it brings up a undesirable context menu.

It is possible to avoid this using:

  EventControllerKey {
    key-pressed => $on_key_pressed() swapped;
  }
klass.bind_template_instance_callbacks();
#[template_callback]
pub fn on_key_pressed(
    &self,
    key: gdk::Key,
    _: u32,
    _: gdk::ModifierType,
    _: &gtk4::EventControllerKey,
) -> glib::Propagation {
    match key {
        gdk::Key::Menu => glib::Propagation::Stop,
        _ => {}
    };

    glib::Propagation::Proceed
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions