ui::ModifierKeys¶
Header: winui/core/Input.hpp.
The modifier keys held with a key or a pointer event, and the ones a KeyCombo asks for.
Example:
class ListControl : public ui::Element
{
protected:
bool pointer_override(const ui::PointerEvent& e) override
{
if (e.action == ui::PointerAction::Down && e.modifiers.shift)
{
extend_selection_to(e.position);
return true;
}
return false;
}
bool key_override(const ui::KeyEvent& e) override
{
// Exactly Ctrl+Shift, nothing else held.
return e.modifiers == ui::ModifierKeys{.ctrl = true, .shift = true};
}
private:
void extend_selection_to(ui::Point position);
};
ctrl¶
Ctrl.
shift¶
Shift.
alt¶
Alt.
win¶
The Windows logo key.
none¶
True when no modifier is held.