Skip to content

Commit c04c2c7

Browse files
committed
Fix Kitty Keyboard Modifiers bitflags
The Kitty keyboard spec supports caps_lock and num_lock as well. The main bug here was a copy-paste where HYPER AND META were both shifted to the same value (`1 << 5`). This change fixes both issues. We also switch to using the same numerical values as the spec, both for symmetry with the spec but also to keep the value within a u8. https://sw.kovidgoyal.net/kitty/keyboard-protocol/#modifiers
1 parent 5435c2d commit c04c2c7

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

src/event.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,12 +83,15 @@ bitflags::bitflags! {
8383
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
8484
pub struct Modifiers: u8 {
8585
const NONE = 0;
86-
const SHIFT = 1 << 1;
87-
const ALT = 1 << 2;
88-
const CONTROL = 1 << 3;
89-
const SUPER = 1 << 4;
90-
const HYPER = 1 << 5;
86+
const SHIFT = 1;
87+
const ALT = 1 << 1;
88+
const CONTROL = 1 << 2;
89+
/// Windows/Linux key or Command key on Macs.
90+
const SUPER = 1 << 3;
91+
const HYPER = 1 << 4;
9192
const META = 1 << 5;
93+
const CAPS_LOCK = 1 << 6;
94+
const NUM_LOCK = 1 << 7;
9295
}
9396
}
9497

0 commit comments

Comments
 (0)