pub trait DisplayExtManual: 'static {
    // Required methods
    fn translate_key(
        &self,
        keycode: u32,
        state: ModifierType,
        group: i32
    ) -> Option<(Key, i32, i32, ModifierType)>;
    fn get_setting(&self, name: impl IntoGStr) -> Option<Value>;
    fn map_keyval(&self, keyval: Key) -> Option<Vec<KeymapKey>>;
    fn map_keycode(&self, keycode: u32) -> Option<Vec<(KeymapKey, Key)>>;
    fn backend(&self) -> Backend;
}
Expand description

Trait containing manually implemented methods of Display.

Required Methods§

source

fn translate_key( &self, keycode: u32, state: ModifierType, group: i32 ) -> Option<(Key, i32, i32, ModifierType)>

Translates the contents of a GdkEventKey into a keyval, effective group, and level.

Modifiers that affected the translation and are thus unavailable for application use are returned in @consumed_modifiers.

The @effective_group is the group that was actually used for the translation; some keys such as Enter are not affected by the active keyboard group. The @level is derived from @state.

@consumed_modifiers gives modifiers that should be masked out from @state when comparing this key press to a keyboard shortcut. For instance, on a US keyboard, the plus symbol is shifted, so when comparing a key press to a <Control>plus accelerator <Shift> should be masked out.

This function should rarely be needed, since GdkEventKey already contains the translated keyval. It is exported for the benefit of virtualized test environments.

keycode

a keycode

state

a modifier state

group

active keyboard group

Returns

true if there was a keyval bound to keycode/state/group.

keyval

return location for keyval

effective_group

return location for effective group

level

return location for level

consumed

return location for modifiers that were used to determine the group or level

source

fn get_setting(&self, name: impl IntoGStr) -> Option<Value>

Retrieves a desktop-wide setting such as double-click time for the @self.

name

the name of the setting

value

location to store the value of the setting

Returns

true if the setting existed and a value was stored in @value, false otherwise

source

fn map_keyval(&self, keyval: Key) -> Option<Vec<KeymapKey>>

source

fn map_keycode(&self, keycode: u32) -> Option<Vec<(KeymapKey, Key)>>

source

fn backend(&self) -> Backend

Get the currently used display backend

Implementors§