Skip to content

Commit

Permalink
Disable shortcut beep sound
Browse files Browse the repository at this point in the history
  • Loading branch information
glushchenko committed Aug 15, 2017
1 parent 8037ab5 commit 2864995
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 0 additions & 2 deletions FSNotes/EditTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,5 @@ class EditTextView: NSTextView {
let viewController = self.window?.contentViewController as? ViewController
viewController?.search.becomeFirstResponder()
}

super.keyDown(with: event)
}
}
7 changes: 3 additions & 4 deletions FSNotes/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,17 +170,13 @@ class ViewController: NSViewController,
if (event.keyCode == 53) {
cleanSearchAndEditArea()
}

super.keyUp(with: event)
}

// Focus search field shortcut (cmd-L)
override func keyDown(with event: NSEvent) {
if (event.keyCode == 37 && event.modifierFlags.contains(.command)) {
search.becomeFirstResponder()
}

super.keyDown(with: event)
}

override func controlTextDidEndEditing(_ obj: Notification) {
Expand Down Expand Up @@ -221,6 +217,7 @@ class ViewController: NSViewController,

func makeNoteShortcut() {
NSApp.activate(ignoringOtherApps: true)
self.view.window?.makeKeyAndOrderFront(self)

if (notesTableView.noteList[0].content.characters.count == 0) {
selectNullTableRow()
Expand All @@ -232,6 +229,8 @@ class ViewController: NSViewController,

func searchShortcut() {
NSApp.activate(ignoringOtherApps: true)
self.view.window?.makeKeyAndOrderFront(self)

cleanSearchAndEditArea()
}
}
Expand Down

0 comments on commit 2864995

Please sign in to comment.