pub struct Key(_);
Expand description
A wrapper around GDK_KEY_
constants and keyval methods.
Implementations
sourceimpl Key
impl Key
sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
Converts a key name to a key value.
The names are the same as those in the
gdk/gdkkeysyms.h
header file
but without the leading “GDK_KEY_”.
keyval_name
a key name
Returns
the corresponding key value, or GDK_KEY_VoidSymbol
if the key name is not a valid key
sourcepub fn convert_case(&self) -> (Self, Self)
pub fn convert_case(&self) -> (Self, Self)
sourcepub fn to_unicode(&self) -> Option<char>
pub fn to_unicode(&self) -> Option<char>
Convert from a GDK key symbol to the corresponding Unicode character.
Note that the conversion does not take the current locale
into consideration, which might be expected for particular
keyvals, such as GDK_KEY_KP_Decimal
.
keyval
a GDK key symbol
Returns
the corresponding unicode character, or 0 if there is no corresponding character.