博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
iphone-common-codes-ccteam源代码 CCKeyboard.m
阅读量:6413 次
发布时间:2019-06-23

本文共 2465 字,大约阅读时间需要 8 分钟。

// //  CCKeyboard.m //  CCFC // //  Created by xichen on 11-12-23. //  Copyright 2011 ccteam. All rights reserved. // #import "CCKeyboard.h" @implementation CCKeyboard + (UITextInputMode *)currentInputMode {
return [UITextInputMode currentInputMode]; } + (NSString *)primaryLanguage {
return [[UITextInputMode currentInputMode] primaryLanguage]; } // default rect in portrait mode + (CGRect)defaultPortraitKeyboardRect {
return CGRectMake(0, 264, 320, 216); } // get the window of keyboard + (UIWindow *)getKeyboardWindow {
NSArray *arr = [[UIApplication sharedApplication] windows]; for(UIWindow *temp in arr) {
if([temp isMemberOfClass:NSClassFromString(@"UITextEffectsWindow")]) return temp; } return nil; } // get the view of the keyboard + (UIView *)getKeyboardView {
UIWindow *window = [self getKeyboardWindow]; if(window != nil) {
NSMutableArray *arr = [NSMutableArray array]; NSString *keyboardName = [self getKeyboardViewName]; [window getSubViewIsMemberOf:keyboardName array:arr maxSize:1]; if([arr count]) return [arr objectAtIndex:0]; return nil; } return nil; } // get the name of the keyboard + (NSString *)getKeyboardViewName {
float sysVer = [[[UIDevice currentDevice] systemVersion] floatValue]; if(sysVer < 3.2) return @"UIKeyboard"; return @"UIPeripheralHostView"; } #if CC_ENABLE_PRIVATE_API + (NSString *)getCurrentInputMode {
return (NSString *)UIKeyboardGetCurrentInputMode(); } + (NSString *)getLocalizedInputModeName:(NSString *)inputInternalName {
return (NSString *)UIKeyboardLocalizedInputModeName(inputInternalName); } + (NSBundle *)getBundleForInputMode:(NSString *)inputInternalName {
return (NSBundle *)UIKeyboardBundleForInputMode(inputInternalName); } + (NSArray *)getSupportedInputModes {
return (NSArray *)UIKeyboardGetSupportedInputModes(); } + (Class)getInputManagerClassForInputMode:(NSString *)inputInternalName {
return (Class)UIKeyboardInputManagerClassForInputMode(inputInternalName); } + (BOOL)isLayoutDefaultTypeForInputModeIsASCIICapable:(NSString *)inputInternalName {
return UIKeyboardLayoutDefaultTypeForInputModeIsASCIICapable(inputInternalName); } + (BOOL)isInputModeUsesKBStar:(NSString *)inputInternalName {
return UIKeyboardInputModeUsesKBStar(inputInternalName); } #endif @end

googlecode链接地址(会有更新):

转载于:https://www.cnblogs.com/ccteam/archive/2011/12/31/2308432.html

你可能感兴趣的文章
[转]go正则实例
查看>>
Selector中关于顺序的注意事项
查看>>
font-size: 62.5% 的含义
查看>>
MapXtreme 2005 GIS开发入门系列 索引
查看>>
小黑小波比.清空<div>标签内容
查看>>
Java中的ExceptionInInitializerError异常及解决方法
查看>>
Spring 注入bean时的初始化和销毁操作
查看>>
java线程同步原理(lock,synchronized)
查看>>
MyEclipse中使用Hql编辑器找不到Hibernate.cfg.xml文件解决方法
查看>>
yRadio以及其它
查看>>
第四节 对象和类
查看>>
apkplug主题皮肤切换之通用主题-04
查看>>
Python中dict的特点
查看>>
DELL 准备开始拉拢MS了咩
查看>>
SVN提交报错:Attempted to lock an already-locked dir
查看>>
JDK、JRE、JVM三者间的关系
查看>>
小姚说一下工厂模式
查看>>
Oracle千万级记录操作总结
查看>>
闪迪(SanDisk)U盘防伪查询(官方网站)
查看>>
Android onMeasure方法介绍
查看>>