mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-11 13:10:54 +00:00
Merge pull request #725 from zed-industries/fn-input
Avoid text insertion when holding down the `fn` key
This commit is contained in:
commit
909b365ed8
1 changed files with 2 additions and 1 deletions
|
@ -30,6 +30,7 @@ impl Event {
|
||||||
let alt = modifiers.contains(NSEventModifierFlags::NSAlternateKeyMask);
|
let alt = modifiers.contains(NSEventModifierFlags::NSAlternateKeyMask);
|
||||||
let shift = modifiers.contains(NSEventModifierFlags::NSShiftKeyMask);
|
let shift = modifiers.contains(NSEventModifierFlags::NSShiftKeyMask);
|
||||||
let cmd = modifiers.contains(NSEventModifierFlags::NSCommandKeyMask);
|
let cmd = modifiers.contains(NSEventModifierFlags::NSCommandKeyMask);
|
||||||
|
let function = modifiers.contains(NSEventModifierFlags::NSFunctionKeyMask);
|
||||||
|
|
||||||
let unmodified_chars = CStr::from_ptr(
|
let unmodified_chars = CStr::from_ptr(
|
||||||
native_event.charactersIgnoringModifiers().UTF8String() as *mut c_char,
|
native_event.charactersIgnoringModifiers().UTF8String() as *mut c_char,
|
||||||
|
@ -80,7 +81,7 @@ impl Event {
|
||||||
NSF12FunctionKey => "f12",
|
NSF12FunctionKey => "f12",
|
||||||
|
|
||||||
_ => {
|
_ => {
|
||||||
if !cmd && !ctrl {
|
if !cmd && !ctrl && !function {
|
||||||
input = Some(
|
input = Some(
|
||||||
CStr::from_ptr(
|
CStr::from_ptr(
|
||||||
native_event.characters().UTF8String() as *mut c_char
|
native_event.characters().UTF8String() as *mut c_char
|
||||||
|
|
Loading…
Reference in a new issue