diff --git a/crates/gpui/src/interactive.rs b/crates/gpui/src/interactive.rs index 46af946e69..218ae5fcdf 100644 --- a/crates/gpui/src/interactive.rs +++ b/crates/gpui/src/interactive.rs @@ -150,7 +150,7 @@ pub struct MouseClickEvent { } /// A click event that was generated by a keyboard button being pressed and released. -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct KeyboardClickEvent { /// The keyboard button that was pressed to trigger the click. pub button: KeyboardButton, @@ -168,6 +168,12 @@ pub enum ClickEvent { Keyboard(KeyboardClickEvent), } +impl Default for ClickEvent { + fn default() -> Self { + ClickEvent::Keyboard(KeyboardClickEvent::default()) + } +} + impl ClickEvent { /// Returns the modifiers that were held during the click event /// @@ -256,9 +262,10 @@ impl ClickEvent { } /// An enum representing the keyboard button that was pressed for a click event. -#[derive(Hash, PartialEq, Eq, Copy, Clone, Debug)] +#[derive(Hash, PartialEq, Eq, Copy, Clone, Debug, Default)] pub enum KeyboardButton { /// Enter key was clicked + #[default] Enter, /// Space key was clicked Space,