KeyBinding
struct · ferroui-base · v0.5.0
struct KeyBinding
Binds a key gesture to a command.
Members
TYPEto_refcommand_propertycommand_parameter_propertygesture_propertyconstructnewcommandset_commandcommand_parameterset_command_parametergestureset_gesturetry_handle
TYPE
const TYPE: &'static $crate::TypeInfo
The runtime type of this class.
to_ref
fn to_ref(self: &Self) -> $crate::Ref<KeyBinding>
Returns a strong reference to this object.
command_property
fn command_property() -> &'static StyledProperty<Option<Rc<dyn ICommand>>>
Defines the Command property.
command_parameter_property
fn command_parameter_property() -> &'static StyledProperty<Option<BoxedValue>>
Defines the CommandParameter property.
gesture_property
fn gesture_property() -> &'static StyledProperty<Option<KeyGesture>>
Defines the Gesture property.
construct
fn construct() -> Self
Creates the class data; see FerroObject::construct.
new
fn new() -> Ref<Self>
command
fn command(self: &Self) -> Option<Rc<dyn ICommand>>
The command invoked by the binding.
set_command
fn set_command(self: &Self, value: Option<Rc<dyn ICommand>>)
command_parameter
fn command_parameter(self: &Self) -> Option<BoxedValue>
The parameter passed to the command.
set_command_parameter
fn set_command_parameter(self: &Self, value: Option<BoxedValue>)
gesture
fn gesture(self: &Self) -> Option<KeyGesture>
The key gesture that invokes the command.
set_gesture
fn set_gesture(self: &Self, value: Option<KeyGesture>)
try_handle
fn try_handle(self: &Self, args: &KeyEventArgs)
Executes the command and marks the event handled, if the event matches the gesture and the command can execute.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeFerroObjectImplExtClassDefaultsBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyErasedDestructorIntoEitherDerefUpcast<T>Upcast<KeyBinding>StaticTypeObjectTypeSubclassable<T>DefaultConstructibleFerroObjectImpl
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.