pub struct KeyTypeMapping { /* private fields */ }
Expand description
A key-type mapping.
§Example
xkb_types {
type "X" {
modifiers = Shift+Mod1;
map[Shift] = Level2;
map[Mod1] = Level2;
};
};
This object might refer to either map[Shift]
or map[Mod1]
.
Implementations§
Source§impl KeyTypeMapping
impl KeyTypeMapping
Sourcepub fn mask(&self) -> ModifierMask
pub fn mask(&self) -> ModifierMask
Returns the modifier mask of this mapping.
After masking with the type mask, the effective modifiers must match this mask exactly for the mapping to be applicable.
§Example
xkb_types {
type "X" {
modifiers = Shift+Mod1;
map[Shift] = Level2;
map[Mod1] = Level2;
};
};
If this mapping is map[Shift]
, then this function returns
ModifierMask::SHIFT
.
Sourcepub fn preserved(&self) -> ModifierMask
pub fn preserved(&self) -> ModifierMask
Returns the preserved modifiers of this mapping.
If this mapping is applicable, then the preserved modifiers are not consumed by the mapping and might be used for keyboard shortcuts or keysym transformations.
§Example
xkb_types {
type "X" {
modifiers = Control+Shift;
map[Control+Shift] = Level2;
preserve[Control+Shift] = Control;
};
};
If this mapping is map[Control+Shift]
, then function returns
ModifierMask::CONTROL
.
Sourcepub fn consumed(&self) -> ModifierMask
pub fn consumed(&self) -> ModifierMask
Returns the consumed modifiers of this mapping.
If this mapping is applicable, then the consumed modifiers should no longer be considered for keyboard shortcuts and keysym transformations.
§Example
xkb_types {
type "X" {
modifiers = Control+Shift;
map[Control+Shift] = Level2;
preserve[Control+Shift] = Control;
};
};
If this mapping is map[Control+Shift]
, then function returns
ModifierMask::SHIFT
.