Cancel key event in Swift
here is the thing.
I’ve a Swift application with a NSTextField. The user can edit the text inside and validate the change by typing the “enter” key on his keyboard.
However, the enter key is already used for an other action in my software.
How could I bypass my shortcut action for only validate the text?
I thought about using a flag regarding in which even we are but it’s not the most elegant solution I think…
The architecture is the following. The NSTextField is in a file and the other action comes from an other ViewController. The action is mad using the storyboard.
So the NSTextField cannot communicate easily (i.e without a lot of couplage) withe the action in the view controller.
- How can I replace my .xib file with pure Swift 3?
- NSString property: copy or retain?
- How do I launch an application on system startup? (Mac OSX, Cocoa)
- Sum array of unsigned 8-bit integers using the Accelerate framework
- Opening door effect using Core Animation
- Cocoa: Checks required for multiple asynchronous NSURLConnections using same delegate functions?
- GDB missing in OS X v10.9 (Mavericks)
- “This application is modifying the autolayout engine from a background thread”
- Custom UISlider – Increase “hot spot” size
- Azure Push Notification Error from IOS Xcode
- How to make a class conform to a protocol in Swift?
- Swift: #warning equivalent
- pushViewController without navigationcontroller
- None of your accounts are a member, code signing errors after upgrading to Xcode 8
- Swift – Continuous background animation loop
- <form target=“_blank”> not working in iOS 7.0.3
- Set checkmark in UITableView
- Filter Core Data results by property IN array
- Setting size to custom iOS font doesnt work
- Why use id when we can just use NSObject?
- Required code signature missing for a library