iPhone / iPad键盘快捷键? [英] iPhone/iPad keyboard shortcuts?

查看:274
本文介绍了iPhone / iPad键盘快捷键?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的程序中有一个动作,用户需要非常频繁地执行(每个会话可能有几百次),我想为使用蓝牙键盘的用户添加键盘快捷键。有没有办法做到这一点?

There's an action in my program which users need to perform very frequently (potentially hundreds of times per session), and I'd like to add a keyboard shortcut for users with a bluetooth keyboard. Is there any way to do this?

现在,最近我来到是触发的动作,每当输入U ​​+ F8FF字符( Shift + Alt + k ),可以在文本视图中打印苹果徽标字符。当然,如果用户实际想要输入一个苹果符号,这将提出一个问题。

Right now, the closest I've come is triggering the action whenever the U+F8FF character is entered (Shift+Alt+k on an iPad/iPhone/Mac, which prints an apple logo character) in a text view. Of course, this would present an issue if the user actually wanted to input an apple symbol.

有什么更好的方法来支持键盘快捷键(希望 Cmd + something ,而不是 Shift + Alt + 感谢!

Are there any better ways to support keyboard shortcuts (hopefully Cmd+something, rather than Shift+Alt+something)? Thanks!

推荐答案

在Cocoa for Mac OS X下,您将从传递给keyDown:method的NSEvent中收集修饰键信息一个NSResponder对象。 CocoaTouch用UIResponder替换NSResponder,用UIEvent替换NSEvent。 UI版本没有记录的键盘事件支持。我猜,苹果已经扩展UIResponder处理keydown事件,但尚未公开记录的变化。不幸的是,我们只需要等待文档读取修饰键。

Under Cocoa for Mac OS X, you would gather modifier key information from the NSEvent passed to the keyDown: method in an NSResponder object. CocoaTouch replaces the NSResponder with UIResponder and NSEvent with UIEvent. The UI versions don't have documented keyboard event support. I'm guessing that Apple has extended UIResponder to handle keydown events, but hasn't publicly documented the changes yet. Unfortunately that means we'll just have to wait for that documentation to be able to read the modifier keys.

我认为您当前的解决方案是一个很好的解决方案,直到苹果给我们一个支持UIResponder的键盘。

I think your current solution is a fine solution until Apple gives us a keyboard supporting UIResponder.

这篇关于iPhone / iPad键盘快捷键?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆