Hi I am working on an iphone application and want to handle keyboard events in iphone. In Mac, there is a class NSEvent which handles both keyboard and mouse events, and in ios (iphone/ipad) the counterpart of NSEvent is UIEvent which handles only touch events. I know ios API does not provide this functionality, but how can i handle key events in iphone??? Any good tutorial or sth, to get started...
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
相关文章
- 现在使用swift开发ios应用好还是swift?
- Visual Studio Code, MAC OS X, OmniSharp server is
- UITableView dragging distance with UIRefreshContro
- Could I create “Call” button in HTML 5 IPhone appl
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- IntelliJ IDEA can't open projects or add SDK o
You can use notifications to handle events as explained here: http://developer.apple.com/library/ios/#documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html
But the functionality is very limited.
You cant directly code for keyboad;s key and there is no mouse in case of device.
you can make your logics for different kind of charectersets or you can make your logics in textField delgate methods or Textview Delegates method
textView delegate
textField delegate
You can also use Notification for textField and Textview.
For TextField use this
call this register method in viewDidLoad
and for text view you need to change only event name like this