1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use gdk_sys;
use glib::translate::*;
use glib::GString;
use libc::c_uint;
use std::mem::transmute;
pub fn keyval_name(keyval: u32) -> Option<GString> {
skip_assert_initialized!();
unsafe { from_glib_none(gdk_sys::gdk_keyval_name(keyval as c_uint)) }
}
pub fn keyval_to_unicode(keyval: u32) -> Option<char> {
skip_assert_initialized!();
unsafe {
let c: char = transmute(gdk_sys::gdk_keyval_to_unicode(keyval));
if c != '\0' {
Some(c)
} else {
None
}
}
}