Skip to content

Commit d6596a3

Browse files
committed
check whether modifier keys are held
1 parent dda1cda commit d6596a3

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

editor/src/messages/input_preprocessor/input_preprocessor_message_handler.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,12 @@ impl<'a> MessageHandler<InputPreprocessorMessage, InputPreprocessorMessageContex
5353

5454
if !key_repeat {
5555
let no_mouse_buttons_held = self.mouse.mouse_keys.is_empty();
56+
let no_modifier_keys_held = modifier_keys.is_empty();
5657
let same_key_within_threshold = self
5758
.last_key_down
5859
.is_some_and(|(last_key, last_time)| last_key == key && self.time.saturating_sub(last_time) < DOUBLE_CLICK_MILLISECONDS);
5960

60-
if no_mouse_buttons_held && same_key_within_threshold {
61+
if no_mouse_buttons_held && no_modifier_keys_held && same_key_within_threshold {
6162
self.double_tap_key = Some((key, self.time));
6263
self.last_key_down = None;
6364
} else {

0 commit comments

Comments
 (0)