Package org.scijava.input
Interface InputService
-
- All Superinterfaces:
Comparable<Prioritized>,Contextual,Disposable,HasPluginInfo,Identifiable,Initializable,Locatable,Logged,Prioritized,RichPlugin,SciJavaPlugin,SciJavaService,Service,Versioned
- All Known Implementing Classes:
DefaultInputService
public interface InputService extends SciJavaService
Interface for service that tracks the current status of input devices (keyboard and mouse in particular).- Author:
- Barry DeZonia, Curtis Rueden
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description default EventServiceeventService()Display<?>getDisplay()Gets the display associated with the last observed mouse cursor.default EventServicegetEventService()Deprecated.UseeventService()instead.InputModifiersgetModifiers()intgetX()Gets the last observed X coordinate of the mouse cursor, relative to a specific display.intgetY()Gets the last observed Y coordinate of the mouse cursor, relative to a specific display.booleanisAltDown()booleanisAltGrDown()booleanisButtonDown(int button)Gets whether the given mouse button is currently pressed.booleanisCtrlDown()booleanisKeyDown(KeyCode code)booleanisMetaDown()booleanisShiftDown()-
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
-
Methods inherited from interface org.scijava.Disposable
dispose
-
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
-
Methods inherited from interface org.scijava.Locatable
getLocation
-
Methods inherited from interface org.scijava.Prioritized
compareTo, getPriority, setPriority
-
Methods inherited from interface org.scijava.plugin.RichPlugin
getIdentifier, log
-
Methods inherited from interface org.scijava.service.Service
initialize, registerEventHandlers
-
Methods inherited from interface org.scijava.Versioned
getVersion
-
-
-
-
Method Detail
-
eventService
default EventService eventService()
-
getModifiers
InputModifiers getModifiers()
-
isAltDown
boolean isAltDown()
-
isAltGrDown
boolean isAltGrDown()
-
isCtrlDown
boolean isCtrlDown()
-
isMetaDown
boolean isMetaDown()
-
isShiftDown
boolean isShiftDown()
-
isKeyDown
boolean isKeyDown(KeyCode code)
-
getDisplay
Display<?> getDisplay()
Gets the display associated with the last observed mouse cursor.- Returns:
- The display in question, or null if the display has been deleted, or the mouse cursor is outside all known displays, or no mouse events have ever been observed.
-
getX
int getX()
Gets the last observed X coordinate of the mouse cursor, relative to a specific display.- See Also:
getDisplay()
-
getY
int getY()
Gets the last observed Y coordinate of the mouse cursor, relative to a specific display.- See Also:
getDisplay()
-
isButtonDown
boolean isButtonDown(int button)
Gets whether the given mouse button is currently pressed.- Parameters:
button- One of:
-
getEventService
@Deprecated default EventService getEventService()
Deprecated.UseeventService()instead.
-
-