mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-07-27 11:06:31 +00:00
core: scroll viewport back to bottom on any key input that isn't a mod
Fixes #619 This changes the behavior from requiring printable text to any input that isn't a modifier and also generates some data we send to the pty. If there is printable text, we also clear the selection.
This commit is contained in:
@@ -332,6 +332,23 @@ pub const Key = enum(c_int) {
|
||||
};
|
||||
}
|
||||
|
||||
/// True if this key is a modifier.
|
||||
pub fn modifier(self: Key) bool {
|
||||
return switch (self) {
|
||||
.left_shift,
|
||||
.left_control,
|
||||
.left_alt,
|
||||
.left_super,
|
||||
.right_shift,
|
||||
.right_control,
|
||||
.right_alt,
|
||||
.right_super,
|
||||
=> true,
|
||||
|
||||
else => false,
|
||||
};
|
||||
}
|
||||
|
||||
/// Returns true if this is a keypad key.
|
||||
pub fn keypad(self: Key) bool {
|
||||
return switch (self) {
|
||||
|
||||
Reference in New Issue
Block a user