Function gtk_test::key_release
source · [−]Expand description
Send a key release event to the given widget.
Warning!
Please note that the key-release event will “fail” if the window isn’t on top of all other windows (this is a common issue on OSX). Don’t forget to bring the button’s window on top by using:
ⓘ
window.activate_focus();
Example:
#[macro_use]
extern crate gtk_test;
use gtk_test::gtk::{Entry, Inhibit, prelude::WidgetExt};
gtk_test::gtk::init().expect("GTK init failed");
let entry = Entry::new();
entry.connect_key_release_event(|_, _| {
println!("key released");
Inhibit(false)
});
gtk_test::key_release(&entry, gtk_test::gdk::keys::constants::Agrave);