类 InputEvent.Key
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.client.event.InputEvent
net.minecraftforge.client.event.InputEvent.Key
- 封闭类:
InputEvent
Fired when a keyboard key input occurs, such as pressing, releasing, or repeating a key.
This event is not cancellable, and does not have a result.
This event is fired on the main Forge event bus, only on the logical client.
-
嵌套类概要
从类继承的嵌套类/接口 net.minecraftforge.client.event.InputEvent
InputEvent.InteractionKeyMappingTriggered, InputEvent.Key, InputEvent.MouseButton, InputEvent.MouseScrollingEvent
从类继承的嵌套类/接口 net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
字段概要
字段 -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明int
返回 the mouse button's action。int
getKey()
返回 theGLFW
(platform-agnostic) key code。int
返回 a bit field representing the active modifier keys。int
返回 the platform-specific scan code。从类继承的方法 net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
字段详细资料
-
key
private final int key -
scanCode
private final int scanCode -
action
private final int action -
modifiers
private final int modifiers
-
-
构造器详细资料
-
Key
@Internal public Key(int key, int scanCode, int action, int modifiers)
-
-
方法详细资料
-
getKey
public int getKey()返回 theGLFW
(platform-agnostic) key code。- 返回:
- the
GLFW
(platform-agnostic) key code - 另请参阅:
-
getScanCode
public int getScanCode()返回 the platform-specific scan code。The scan code is unique for every key, regardless of whether it has a key code. Scan codes are platform-specific but consistent over time, so keys will have different scan codes depending on the platform but they are safe to save to disk as custom key bindings.
- 返回:
- the platform-specific scan code
- 另请参阅:
-
getAction
public int getAction()返回 the mouse button's action。- 返回:
- the mouse button's action
- 另请参阅:
-
getModifiers
public int getModifiers()返回 a bit field representing the active modifier keys。- 返回:
- a bit field representing the active modifier keys
- 另请参阅:
-