KeyEvent 构造函数

定义

重载

KeyEvent(KeyEvent)

创建现有密钥事件的确切副本。

KeyEvent(KeyEventActions, Keycode)

创建新的密钥事件。

KeyEvent(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

KeyEvent(KeyEvent, Int64, Int32)
已过时.

复制现有密钥事件,修改其时间和重复计数。

KeyEvent(Int64, String, Int32, KeyEventFlags)

为字符串创建一个新键事件。

KeyEvent(Int64, Int64, KeyEventActions, Keycode, Int32)

创建新的密钥事件。

KeyEvent(Int64, Int64, KeyEventActions, Keycode, Int32, MetaKeyStates)

创建新的密钥事件。

KeyEvent(Int64, Int64, KeyEventActions, Keycode, Int32, MetaKeyStates, Int32, Int32)

创建新的密钥事件。

KeyEvent(Int64, Int64, KeyEventActions, Keycode, Int32, MetaKeyStates, Int32, Int32, KeyEventFlags)

创建新的密钥事件。

KeyEvent(Int64, Int64, KeyEventActions, Keycode, Int32, MetaKeyStates, Int32, Int32, KeyEventFlags, InputSourceType)

创建新的密钥事件。

KeyEvent(KeyEvent)

创建现有密钥事件的确切副本。

[Android.Runtime.Register(".ctor", "(Landroid/view/KeyEvent;)V", "")]
public KeyEvent (Android.Views.KeyEvent? origEvent);
[<Android.Runtime.Register(".ctor", "(Landroid/view/KeyEvent;)V", "")>]
new Android.Views.KeyEvent : Android.Views.KeyEvent -> Android.Views.KeyEvent

参数

origEvent
KeyEvent
属性

注解

创建现有密钥事件的确切副本。

适用于 . 的 android.view.KeyEvent.KeyEvent(android.view.KeyEvent)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

KeyEvent(KeyEventActions, Keycode)

创建新的密钥事件。

[Android.Runtime.Register(".ctor", "(II)V", "")]
public KeyEvent (Android.Views.KeyEventActions action, Android.Views.Keycode code);
[<Android.Runtime.Register(".ctor", "(II)V", "")>]
new Android.Views.KeyEvent : Android.Views.KeyEventActions * Android.Views.Keycode -> Android.Views.KeyEvent

参数

action
KeyEventActions

操作代码:或 #ACTION_DOWN#ACTION_UP#ACTION_MULTIPLE

code
Keycode

密钥代码。

属性

注解

创建新的密钥事件。

适用于 . 的 android.view.KeyEvent.KeyEvent(int, int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

KeyEvent(IntPtr, JniHandleOwnership)

创建 JNI 对象的托管表示形式时使用的构造函数;由运行时调用。

protected KeyEvent (IntPtr javaReference, Android.Runtime.JniHandleOwnership transfer);
new Android.Views.KeyEvent : nativeint * Android.Runtime.JniHandleOwnership -> Android.Views.KeyEvent

参数

javaReference
IntPtr

nativeint

IntPtr一个包含 Java 本机接口 (JNI) 对象引用。

transfer
JniHandleOwnership

指示 JniHandleOwnership如何处理 javaReference

注解

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

KeyEvent(KeyEvent, Int64, Int32)

注意

deprecated

复制现有密钥事件,修改其时间和重复计数。

[Android.Runtime.Register(".ctor", "(Landroid/view/KeyEvent;JI)V", "")]
[System.Obsolete("deprecated")]
public KeyEvent (Android.Views.KeyEvent? origEvent, long eventTime, int newRepeat);
[<Android.Runtime.Register(".ctor", "(Landroid/view/KeyEvent;JI)V", "")>]
[<System.Obsolete("deprecated")>]
new Android.Views.KeyEvent : Android.Views.KeyEvent * int64 * int -> Android.Views.KeyEvent

参数

origEvent
KeyEvent

要复制的现有事件。

eventTime
Int64

事件的新事件时间(in android.os.SystemClock#uptimeMillis)。

newRepeat
Int32

事件的新重复计数。

属性

注解

复制现有密钥事件,修改其时间和重复计数。

此成员已弃用。 请改用 #changeTimeRepeat(KeyEvent, long, int)

适用于 . 的 android.view.KeyEvent.KeyEvent(android.view.KeyEvent, long, int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

KeyEvent(Int64, String, Int32, KeyEventFlags)

为字符串创建一个新键事件。

[Android.Runtime.Register(".ctor", "(JLjava/lang/String;II)V", "")]
public KeyEvent (long time, string? characters, int deviceId, Android.Views.KeyEventFlags flags);
[<Android.Runtime.Register(".ctor", "(JLjava/lang/String;II)V", "")>]
new Android.Views.KeyEvent : int64 * string * int * Android.Views.KeyEventFlags -> Android.Views.KeyEvent

参数

time
Int64

发生此事件的时间(in android.os.SystemClock#uptimeMillis)。

characters
String

字符字符串。

deviceId
Int32

生成密钥事件的设备 ID。

flags
KeyEventFlags

此密钥事件的标志

属性

注解

为字符串创建一个新键事件。 密钥代码、操作、重复计数和源将自动设置为 #KEYCODE_UNKNOWN、、 #ACTION_MULTIPLE0 和 InputDevice#SOURCE_KEYBOARD 你。

适用于 . 的 android.view.KeyEvent.KeyEvent(long, java.lang.String, int, int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

KeyEvent(Int64, Int64, KeyEventActions, Keycode, Int32)

创建新的密钥事件。

[Android.Runtime.Register(".ctor", "(JJIII)V", "")]
public KeyEvent (long downTime, long eventTime, Android.Views.KeyEventActions action, Android.Views.Keycode code, int repeat);
[<Android.Runtime.Register(".ctor", "(JJIII)V", "")>]
new Android.Views.KeyEvent : int64 * int64 * Android.Views.KeyEventActions * Android.Views.Keycode * int -> Android.Views.KeyEvent

参数

downTime
Int64

此密钥代码最初关闭的时间(in android.os.SystemClock#uptimeMillis)。

eventTime
Int64

事件发生的时间(在 android.os.SystemClock#uptimeMillis) 。

action
KeyEventActions

操作代码:或 #ACTION_DOWN#ACTION_UP#ACTION_MULTIPLE

code
Keycode

密钥代码。

repeat
Int32

对倒数事件重复计数(> 如果这是在初始关闭之后)或多个事件的事件计数。

属性

注解

创建新的密钥事件。

适用于 . 的 android.view.KeyEvent.KeyEvent(long, long, int, int, int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

KeyEvent(Int64, Int64, KeyEventActions, Keycode, Int32, MetaKeyStates)

创建新的密钥事件。

[Android.Runtime.Register(".ctor", "(JJIIII)V", "")]
public KeyEvent (long downTime, long eventTime, Android.Views.KeyEventActions action, Android.Views.Keycode code, int repeat, Android.Views.MetaKeyStates metaState);
[<Android.Runtime.Register(".ctor", "(JJIIII)V", "")>]
new Android.Views.KeyEvent : int64 * int64 * Android.Views.KeyEventActions * Android.Views.Keycode * int * Android.Views.MetaKeyStates -> Android.Views.KeyEvent

参数

downTime
Int64

此密钥代码最初关闭的时间(in android.os.SystemClock#uptimeMillis)。

eventTime
Int64

事件发生的时间(在 android.os.SystemClock#uptimeMillis) 。

action
KeyEventActions

操作代码:或 #ACTION_DOWN#ACTION_UP#ACTION_MULTIPLE

code
Keycode

密钥代码。

repeat
Int32

对倒数事件重复计数(> 如果这是在初始关闭之后)或多个事件的事件计数。

metaState
MetaKeyStates

指示当前按下的元键的标志。

属性

注解

创建新的密钥事件。

适用于 . 的 android.view.KeyEvent.KeyEvent(long, long, int, int, int, int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

KeyEvent(Int64, Int64, KeyEventActions, Keycode, Int32, MetaKeyStates, Int32, Int32)

创建新的密钥事件。

[Android.Runtime.Register(".ctor", "(JJIIIIII)V", "")]
public KeyEvent (long downTime, long eventTime, Android.Views.KeyEventActions action, Android.Views.Keycode code, int repeat, Android.Views.MetaKeyStates metaState, int deviceId, int scancode);
[<Android.Runtime.Register(".ctor", "(JJIIIIII)V", "")>]
new Android.Views.KeyEvent : int64 * int64 * Android.Views.KeyEventActions * Android.Views.Keycode * int * Android.Views.MetaKeyStates * int * int -> Android.Views.KeyEvent

参数

downTime
Int64

此密钥代码最初关闭的时间(in android.os.SystemClock#uptimeMillis)。

eventTime
Int64

事件发生的时间(在 android.os.SystemClock#uptimeMillis) 。

action
KeyEventActions

操作代码:或 #ACTION_DOWN#ACTION_UP#ACTION_MULTIPLE

code
Keycode

密钥代码。

repeat
Int32

对倒数事件重复计数(> 如果这是在初始关闭之后)或多个事件的事件计数。

metaState
MetaKeyStates

指示当前按下的元键的标志。

deviceId
Int32

生成密钥事件的设备 ID。

scancode
Int32

事件的原始设备扫描代码。

属性

注解

创建新的密钥事件。

适用于 . 的 android.view.KeyEvent.KeyEvent(long, long, int, int, int, int, int, int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

KeyEvent(Int64, Int64, KeyEventActions, Keycode, Int32, MetaKeyStates, Int32, Int32, KeyEventFlags)

创建新的密钥事件。

[Android.Runtime.Register(".ctor", "(JJIIIIIII)V", "")]
public KeyEvent (long downTime, long eventTime, Android.Views.KeyEventActions action, Android.Views.Keycode code, int repeat, Android.Views.MetaKeyStates metaState, int deviceId, int scancode, Android.Views.KeyEventFlags flags);
[<Android.Runtime.Register(".ctor", "(JJIIIIIII)V", "")>]
new Android.Views.KeyEvent : int64 * int64 * Android.Views.KeyEventActions * Android.Views.Keycode * int * Android.Views.MetaKeyStates * int * int * Android.Views.KeyEventFlags -> Android.Views.KeyEvent

参数

downTime
Int64

此密钥代码最初关闭的时间(in android.os.SystemClock#uptimeMillis)。

eventTime
Int64

事件发生的时间(在 android.os.SystemClock#uptimeMillis) 。

action
KeyEventActions

操作代码:或 #ACTION_DOWN#ACTION_UP#ACTION_MULTIPLE

code
Keycode

密钥代码。

repeat
Int32

对倒数事件重复计数(> 如果这是在初始关闭之后)或多个事件的事件计数。

metaState
MetaKeyStates

指示当前按下的元键的标志。

deviceId
Int32

生成密钥事件的设备 ID。

scancode
Int32

事件的原始设备扫描代码。

flags
KeyEventFlags

此密钥事件的标志

属性

注解

创建新的密钥事件。

适用于 . 的 android.view.KeyEvent.KeyEvent(long, long, int, int, int, int, int, int, int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于

KeyEvent(Int64, Int64, KeyEventActions, Keycode, Int32, MetaKeyStates, Int32, Int32, KeyEventFlags, InputSourceType)

创建新的密钥事件。

[Android.Runtime.Register(".ctor", "(JJIIIIIIII)V", "")]
public KeyEvent (long downTime, long eventTime, Android.Views.KeyEventActions action, Android.Views.Keycode code, int repeat, Android.Views.MetaKeyStates metaState, int deviceId, int scancode, Android.Views.KeyEventFlags flags, Android.Views.InputSourceType source);
[<Android.Runtime.Register(".ctor", "(JJIIIIIIII)V", "")>]
new Android.Views.KeyEvent : int64 * int64 * Android.Views.KeyEventActions * Android.Views.Keycode * int * Android.Views.MetaKeyStates * int * int * Android.Views.KeyEventFlags * Android.Views.InputSourceType -> Android.Views.KeyEvent

参数

downTime
Int64

此密钥代码最初关闭的时间(in android.os.SystemClock#uptimeMillis)。

eventTime
Int64

事件发生的时间(在 android.os.SystemClock#uptimeMillis) 。

action
KeyEventActions

操作代码:或 #ACTION_DOWN#ACTION_UP#ACTION_MULTIPLE

code
Keycode

密钥代码。

repeat
Int32

对倒数事件重复计数(> 如果这是在初始关闭之后)或多个事件的事件计数。

metaState
MetaKeyStates

指示当前按下的元键的标志。

deviceId
Int32

生成密钥事件的设备 ID。

scancode
Int32

事件的原始设备扫描代码。

flags
KeyEventFlags

此密钥事件的标志

source
InputSourceType

输入源,例如 InputDevice#SOURCE_KEYBOARD

属性

注解

创建新的密钥事件。

适用于 . 的 android.view.KeyEvent.KeyEvent(long, long, int, int, int, int, int, int, int, int)Java 文档

本页的某些部分是根据 Android 开放源代码项目创建和共享的工作进行的修改,并根据 Creative Commons 2.5 属性许可证中所述的术语使用。

适用于