问题标签 [uikeyinput]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
0 回答
65 浏览

ios - 不显示键盘的 iOS 击键

我有一个外部扫描仪,如果键盘处于活动状态,它基本上可以模拟击键。我进行了测试,每当文本字段焦点打开时,它都会模拟击键。但我不想向用户显示键盘。

我可以在不向用户显示键盘的情况下获得击键吗?或者是否可以在整个应用程序中始终激活屏幕外键盘?

0 投票
0 回答
52 浏览

ios - UIKeyInput 的提前输入问题

我有一个控制器,它接受自定义键输入并以独特的方式显示它。它成为关键响应者并实现UIKeyInput

https://developer.apple.com/reference/uikit/uikeyinput

它是在 8.0 中实现的,在 iOS 键盘上的预输入功能之前。我正在为 10.0 更新它,但它不能很好地管理交互。

When one of the type ahead words is selected, insertText:is invoked, but the newtextvalue is always 0xa000000000000201and the debug output is

0 投票
1 回答
84 浏览

ios - UIKeyInput 在 iPad 上不可用?

我已经实现了UIKeyInput协议方法- (void)deleteBackward,但是当代码在 iPad 上运行并且我按下键盘上的删除按钮时,它不会执行该方法。

此协议是否已禁用ipad

0 投票
1 回答
62 浏览

ios - 预测视图位于键盘按键下方

我有一个 UILabel 子类,符合 UIKeyInputs 协议。但是当显示键盘时,预测视图位于键盘键下方:这是屏幕截图:

截图

这是实现:

我不明白的一件事是 autocapitalizationType、autocorrectionType 和其他用于键盘外观的协议方法没有被调用。

我希望有人能帮帮忙。谢谢你。

0 投票
0 回答
359 浏览

ios - 如何实现 UIKeyInput

我有一个带有多个选项的pickerView。我想要的是,当用户在 pickerView 中选择“B”选项时,pickerView 消失并且常规键盘出现,因此用户可以将自己的值输入到文本字段中。我真的不明白 UIKeyInput 是如何工作的。对于pickerViews,我可以做一些类似的事情var datePicker = UIDatePicker(),然后稍后dateTextField.inputView = datePicker它不允许我用 UIKeyInput 做到这一点。当我这样做var customShutterSpeed = UIKeyInput()时,它给了我错误“'UIKeyInput' 无法构造,因为它没有可访问的初始化程序”这难道不是正确的 inputView 来调出常规键盘吗?此外,在 pickerView didSelectRow 中,我有以下代码来确定用户是否选择了应该调出键盘的选项:

在 ViewController 文件的顶部,我说var B:String = "B"这无法确定是否在 pickerView 中选择了“B”选项。顺便说一句,phoneNumberTextField 是快门速度选项出现的文本字段,我只是对某些变量有奇怪的名称。此外,正如您可能知道的那样,我不太擅长 swift。

0 投票
2 回答
2333 浏览

c# - 如何检测 WPF 中的按键?

我在 WPF 中编写了一个带有几个按钮的桌面应用程序。到目前为止它有效,但现在我想将按钮链接到键。我希望程序检测是否按下按钮,然后执行 Button_click 方法。我试图通过添加这个方法来实现这一点

但它根本没有用。如何将定义的按钮方法链接到键?

0 投票
1 回答
171 浏览

swift - UIKeyInput keyboard type protocol requirement does not match

I have a UIView subclass which conforms to UIKeyInput protocol. I want to set the keyboard type to numberPad. Unfortunately, setting this property does nothing.

Compiler warns me with the following description:

Property 'keyboardType' nearly matches optional requirement 'keyboardType' of protocol 'UITextInputTraits'

Therefore, I know that this property does not refer to the UIKeyInput protocol. I was looking for other protocols or classes called UIKeyInput, but I didn't find any.

Do you have any suggestion what else can cause this issue?