Fix #252 on macOS.
This commit is contained in:
parent
77f902b5d5
commit
92e49b4d65
|
@ -194,6 +194,7 @@ extern fn keypress_callback(_self: *mut c_void, raw_buffer: *const u8, len: i32,
|
|||
0x3B => Some(LEFT_CTRL),
|
||||
0x3E => Some(RIGHT_CTRL),
|
||||
0x33 => Some(BACKSPACE),
|
||||
0x39 => Some(CAPS_LOCK),
|
||||
_ => None,
|
||||
};
|
||||
|
||||
|
|
|
@ -79,6 +79,9 @@ pub enum KeyModifier {
|
|||
RIGHT_META,
|
||||
LEFT_SHIFT,
|
||||
RIGHT_SHIFT,
|
||||
|
||||
// Special cases, should not be used in config
|
||||
CAPS_LOCK,
|
||||
}
|
||||
|
||||
impl KeyModifier {
|
||||
|
|
|
@ -21,7 +21,7 @@ use crate::matcher::{Match, MatchReceiver, TriggerEntry};
|
|||
use std::cell::{RefCell};
|
||||
use crate::event::{KeyModifier, ActionEventReceiver, ActionType};
|
||||
use crate::config::ConfigManager;
|
||||
use crate::event::KeyModifier::BACKSPACE;
|
||||
use crate::event::KeyModifier::{BACKSPACE, LEFT_SHIFT, RIGHT_SHIFT, CAPS_LOCK};
|
||||
use std::time::SystemTime;
|
||||
use std::collections::VecDeque;
|
||||
|
||||
|
@ -237,8 +237,10 @@ impl <'a, R: MatchReceiver, M: ConfigManager<'a>> super::Matcher for ScrollingMa
|
|||
}
|
||||
|
||||
// Consider modifiers as separators to improve word matches reliability
|
||||
let mut was_previous_char_word_separator = self.was_previous_char_word_separator.borrow_mut();
|
||||
*was_previous_char_word_separator = true;
|
||||
if m != LEFT_SHIFT && m != RIGHT_SHIFT && m != CAPS_LOCK {
|
||||
let mut was_previous_char_word_separator = self.was_previous_char_word_separator.borrow_mut();
|
||||
*was_previous_char_word_separator = true;
|
||||
}
|
||||
}
|
||||
|
||||
fn handle_other(&self) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user