public class GermKeyAPI
extends java.lang.Object
提供按键注册、取消注册和按键绑定管理功能
注册按键后,服务器才能监听到相应的按键事件
Constructor and Description |
---|
GermKeyAPI() |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,KeyBinding> |
getRegisteredKeyBinding()
获取所有已注册的按键绑定
|
static java.util.Set<KeyType> |
getRegisteredKeys()
获得被注册的按键列表
|
static void |
registerKey(int keyId)
Deprecated.
请使用
registerKey(KeyType) 方法 |
static void |
registerKey(KeyType keyType)
注册按键
不注册服务器不会监听到事件 |
static void |
registerKeyBinding(KeyBinding keyBinding)
注册按键绑定
将按键绑定信息发送给所有在线玩家
|
static void |
sendRegisteredKeysToAllPlayer()
给全体玩家发送所有被注册的按键和按键绑定
通常在玩家加入服务器或重载配置时调用
|
static void |
unregisterKey(int keyId)
Deprecated.
请使用
unregisterKey(KeyType) 方法 |
static void |
unregisterKey(KeyType keyType)
取消按键注册
|
static void |
unregisterKeyBinding(KeyBinding keyBinding)
取消注册按键绑定
|
static void |
unregisterKeyBinding(java.lang.String index)
通过索引取消注册按键绑定
|
@Deprecated public static void registerKey(int keyId)
registerKey(KeyType)
方法keyId
- 按键的IDpublic static void registerKey(KeyType keyType)
keyType
- 按键类型public static void registerKeyBinding(KeyBinding keyBinding)
将按键绑定信息发送给所有在线玩家
keyBinding
- 按键绑定对象public static void unregisterKeyBinding(KeyBinding keyBinding)
keyBinding
- 要取消注册的按键绑定对象public static void unregisterKeyBinding(java.lang.String index)
index
- 按键绑定索引public static java.util.Map<java.lang.String,KeyBinding> getRegisteredKeyBinding()
@Deprecated public static void unregisterKey(int keyId)
unregisterKey(KeyType)
方法keyId
- 按键IDpublic static void unregisterKey(KeyType keyType)
keyType
- 按键类型public static java.util.Set<KeyType> getRegisteredKeys()
public static void sendRegisteredKeysToAllPlayer()
通常在玩家加入服务器或重载配置时调用