繁体   English   中英

检测iOS键盘上何时按下“ @ 123”按钮

[英]Detect when the “@123” button is pressed on the iOS keyboard

是否可以检测何时在键盘上按下了“ @ 123”? 我有一个自定义输入附件视图,我希望根据向用户显示的键盘进行更改。

在此处输入图片说明

引用以下链接

您可以注册UITextInputCurrentInputModeDidChangeNotification ,以在当前输入模式更改时收到警报。”

[[NSNotificationCenter defaultCenter] addObserver:self
                                     selector:@selector(inputModeDidChange:)
                                         name:UIKeyboardCurrentInputModeDidChangeNotification
                                       object:nil];

- (void)inputModeDidChange:(NSNotification*)notification
{
    id obj = [notification object];
    if ([obj respondsToSelector:@selector(inputModeLastUsedPreference)]) {
    id mode = [obj performSelector:@selector(inputModeLastUsedPreference)];
        NSLog(@"mode: %@", mode);
    }
}

可能重复,您是否看过

这篇文章( 检测当前的iPhone输入语言 )或这篇文章( 如何检测iOS默认键盘类型何时从文本切换为数字

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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