Add Caps Lock support (#30470)

Closes #21700

Release Notes:

- Added caps lock support and show a warning if the user is entering an
SSH password with Caps Lock enabled

---------

Co-authored-by: Mikayla Maki <mikayla@zed.dev>
Co-authored-by: Mikayla Maki <mikayla.c.maki@gmail.com>
Co-authored-by: 张小白 <364772080@qq.com>
This commit is contained in:
Maxim Zaks
2025-06-18 00:43:33 +00:00
committed by GitHub
co-authored by Mikayla Maki Mikayla Maki 张小白
parent e47c48fd3b
commit 90aa99bb14
16 changed files with 146 additions and 31 deletions
+4 -2
View File
@@ -1,6 +1,6 @@
use crate::{
Context, Empty, IntoElement, Keystroke, Modifiers, Pixels, Point, Render, Window, point,
seal::Sealed,
Capslock, Context, Empty, IntoElement, Keystroke, Modifiers, Pixels, Point, Render, Window,
point, seal::Sealed,
};
use smallvec::SmallVec;
use std::{any::Any, fmt::Debug, ops::Deref, path::PathBuf};
@@ -55,6 +55,8 @@ impl KeyEvent for KeyUpEvent {}
pub struct ModifiersChangedEvent {
/// The new state of the modifier keys
pub modifiers: Modifiers,
/// The new state of the capslock key
pub capslock: Capslock,
}
impl Sealed for ModifiersChangedEvent {}