Skip to content

Commit

Permalink
Merge remote-tracking branch 'cypheon/feature/space-key-handling' int…
Browse files Browse the repository at this point in the history
…o develop2
  • Loading branch information
qvacua committed Jun 19, 2020
2 parents 848e5fd + dd73381 commit 5cafc54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions NvimView/NvimView/KeyUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,5 @@ private let specialKeys = [
0x09: "Tab",
0x19: "Tab",
0xd: "CR",
0x20: "Space",
]
8 changes: 8 additions & 0 deletions NvimView/NvimView/NvimView+Key.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,14 @@ extension NvimView {
return false
}

// Space key (especially in combination with modifiers) can result in
// unexpected chars (e.g. ctrl-space = \0), so catch the event early and
// pass it to keyDown.
if 49 == event.keyCode {
self.keyDown(with: event)
return true
}

guard let chars = event.characters else {
return false;
}
Expand Down

0 comments on commit 5cafc54

Please sign in to comment.