public class DefaultInputService extends AbstractService implements InputService
InputService
.Constructor and Description |
---|
DefaultInputService() |
Modifier and Type | Method and Description |
---|---|
EventService |
eventService() |
Display<?> |
getDisplay()
Gets the display associated with the last observed mouse cursor.
|
InputModifiers |
getModifiers() |
int |
getX()
Gets the last observed X coordinate of the mouse cursor, relative to a
specific display.
|
int |
getY()
Gets the last observed Y coordinate of the mouse cursor, relative to a
specific display.
|
boolean |
isAltDown() |
boolean |
isAltGrDown() |
boolean |
isButtonDown(int button)
Gets whether the given mouse button is currently pressed.
|
boolean |
isCtrlDown() |
boolean |
isKeyDown(KeyCode code) |
boolean |
isMetaDown() |
boolean |
isShiftDown() |
protected void |
onEvent(DisplayDeletedEvent evt) |
void |
onEvent(KyPressedEvent evt) |
void |
onEvent(KyReleasedEvent evt) |
protected void |
onEvent(MsExitedEvent evt) |
protected void |
onEvent(MsMovedEvent evt) |
protected void |
onEvent(MsPressedEvent evt) |
protected void |
onEvent(MsReleasedEvent evt) |
getContext, setContext, toString
getInfo, getPriority, setInfo, setPriority
context
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getEventService
initialize, registerEventHandlers
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
dispose
public EventService eventService()
eventService
in interface InputService
public InputModifiers getModifiers()
getModifiers
in interface InputService
public boolean isAltDown()
isAltDown
in interface InputService
public boolean isAltGrDown()
isAltGrDown
in interface InputService
public boolean isCtrlDown()
isCtrlDown
in interface InputService
public boolean isMetaDown()
isMetaDown
in interface InputService
public boolean isShiftDown()
isShiftDown
in interface InputService
public boolean isKeyDown(KeyCode code)
isKeyDown
in interface InputService
public Display<?> getDisplay()
InputService
getDisplay
in interface InputService
public int getX()
InputService
getX
in interface InputService
InputService.getDisplay()
public int getY()
InputService
getY
in interface InputService
InputService.getDisplay()
public boolean isButtonDown(int button)
InputService
isButtonDown
in interface InputService
button
- One of:
public void onEvent(KyPressedEvent evt)
public void onEvent(KyReleasedEvent evt)
protected void onEvent(MsMovedEvent evt)
protected void onEvent(MsExitedEvent evt)
protected void onEvent(MsPressedEvent evt)
protected void onEvent(MsReleasedEvent evt)
protected void onEvent(DisplayDeletedEvent evt)
Copyright © 2015–2022 SciJava. All rights reserved.