包 | flash.ui |
类 | public final class KeyboardType |
继承 | KeyboardType Object |
语言版本: | ActionScript 3.0 |
运行时版本: | Flash Player 10.1, AIR 2 |
将 KeyboardType 类定义的值与 Keybooard.physicalKeyboardType
属性配合使用。
相关 API 元素
公共常量
常量 | 由以下参数定义 | ||
---|---|---|---|
ALPHANUMERIC : String = "alphanumeric" [静态]
具有完整数字和字母集的标准键盘。 | KeyboardType | ||
KEYPAD : String = "keypad" [静态]
电话样式的 12 按钮键盘。 | KeyboardType | ||
NONE : String = "none" [静态]
不支持任何物理键盘。 | KeyboardType |
常量详细信息
ALPHANUMERIC | 常量 |
public static const ALPHANUMERIC:String = "alphanumeric"
语言版本: | ActionScript 3.0 |
运行时版本: | Flash Player 10.1, AIR 2 |
具有完整数字和字母集的标准键盘。
大多数桌面计算机和一些移动设备提供字母数字键盘。
KEYPAD | 常量 |
public static const KEYPAD:String = "keypad"
语言版本: | ActionScript 3.0 |
运行时版本: | Flash Player 10.1, AIR 2 |
电话样式的 12 按钮键盘。
许多移动设备提供了小键盘,尽管一些设备还提供字母数字键盘。
NONE | 常量 |
public static const NONE:String = "none"
语言版本: | ActionScript 3.0 |
运行时版本: | Flash Player 10.1, AIR 2 |
不支持任何物理键盘。
通常,在没有提供物理键盘的情况下提供虚拟键盘。
相关 API 元素
示例 如何使用本示例
KeyboardType.as
以下示例是一个简单测试,用于指示运行环境中“Num Lock”和“Caps Lock”键的当前状态以及键盘类型和触摸屏类型。测试该示例时,单击文本字段可查看属性值:
import flash.events.*; import flash.display.*; import flash.ui.Keyboard; import flash.system.Capabilities; import flash.text.TextField; var keyboardInfoTxt:TextField = new TextField(); keyboardInfoTxt.x = 30; keyboardInfoTxt.y = 50; keyboardInfoTxt.width = 300; keyboardInfoTxt.height = 100; keyboardInfoTxt.border = true; addChild(keyboardInfoTxt); addEventListener (MouseEvent.CLICK, getScreenKeyboardType); function getScreenKeyboardType(e:MouseEvent):void{ keyboardInfoTxt.text= "Caps Lock is : " + String(flash.ui.Keyboard.capsLock)+ "\n" + "Num Lock is : " + String(flash.ui.Keyboard.numLock) +"\n" + "Has Virtual Keyboard : " + String(flash.ui.Keyboard.hasVirtualKeyboard) + "\n" + "Physical Keyboard Type : " + flash.ui.Keyboard.physicalKeyboardType + "\n" + "flash.system.Capabilities.touchscreenType is : " + flash.system.Capabilities.touchscreenType; }
Tue Jun 12 2018, 11:04 AM Z