简体   繁体   中英

iOS 6: Turn off keyboard shortcuts

Is there is any way to turn off keyboard shortcuts in iOS 6 for particular textfield/textview? I want to turn off keyboard shortcut for my app only and not from 'Settings app' of iOS.

I started writing my own text editor to achieve it.

You could try turning off autocorrection for your text field or text view with its autocorrectionType property—if the shortcut functionality is included in that (which seems likely), then it should get disabled as well. I'm pretty sure there's no way to control the shortcut system itself; you might consider filing an enhancement request for it.

There is no standard way to turn off keyboard shortcuts on application level (For non jailbroken iOS). To achieve this I stated with implementation of custom TextView with Core Text and UITextInput protocol. Add @property for keyBoardShortCuts , Override " tokenizer " getter method by following way to turn off shortcuts.

- (id <UITextInputTokenizer>)tokenizer {
    if(self.keyBoardShortCuts)
        return _tokenizer;
    else
        return nil;
}

If we remove tokenizer, there is be no keyboard shortcuts in custom view, even though shortcut are turned on from iOS setting.

Note: Take care of one thing, as we are not depending on tokenizer, now, in this case, use enumerateSubstringsInRange:range options:NSStringEnumerationByWords/Lines block to find out selection range for word or line.

To try this add above code in EGOTextView project to turn off default shortcuts.

From what I know, if you iphone is not jailbroken then you cannot turn it off for particular apps. It is more like a "master setting" that if changed, change applies to everything within iOS.

If it jailbroken, i know there are utility apps you can download that allow you to tweak the OS in that fashion...

Settings > General > Shortcuts. There are ready-made ones and any that you may have set up. They apply across all your iOS devices including your desktop Mac.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM