class LinuxInputDevice extends java.lang.Object implements java.lang.Runnable, InputDevice
Event lines are accumulated in a buffer until an event "EV_SYN EV_SYN_REPORT 0" is received. At this point the listener is notified. The listener can then use the methods getEventType(), getEventCode() and getEventValue() to obtain the details of the current event line to process. nextEvent() and hasNextEvent() are used to iterate over pending events.
To save on RAM and GC, event lines are not objects.
| Modifier and Type | Class and Description |
|---|---|
(package private) class |
LinuxInputDevice.EventProcessor
The EventProcessor is used to notify listeners of pending events.
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.Map<java.lang.Integer,LinuxAbsoluteInputCapabilities> |
absCaps |
private LinuxEventBuffer |
buffer |
private java.util.Map<java.lang.String,java.util.BitSet> |
capabilities |
private java.io.File |
devNode |
private java.nio.ByteBuffer |
event |
private long |
fd |
private java.nio.channels.ReadableByteChannel |
in |
private LinuxInputProcessor |
inputProcessor |
private LinuxInputDevice.EventProcessor |
processor |
private RunnableProcessor |
runnableProcessor |
private java.io.File |
sysPath |
private static LinuxSystem |
system |
private java.util.Map<java.lang.String,java.lang.String> |
udevManifest |
private java.util.Map<java.lang.String,java.lang.String> |
uevent |
| Constructor and Description |
|---|
LinuxInputDevice(java.io.File devNode,
java.io.File sysPath,
java.util.Map<java.lang.String,java.lang.String> udevManifest)
Create a new com.sun.glass.ui.monocle.input.LinuxInputDevice on the given
input node.
|
LinuxInputDevice(java.util.Map<java.lang.String,java.util.BitSet> capabilities,
java.util.Map<java.lang.Integer,LinuxAbsoluteInputCapabilities> absCaps,
java.nio.channels.ReadableByteChannel in,
java.util.Map<java.lang.String,java.lang.String> udevManifest,
java.util.Map<java.lang.String,java.lang.String> uevent)
Create a new simulated LinuxInputDevice
|
| Modifier and Type | Method and Description |
|---|---|
(package private) LinuxAbsoluteInputCapabilities |
getAbsoluteInputCapabilities(int axis) |
(package private) LinuxEventBuffer |
getBuffer() |
(package private) java.util.BitSet |
getCapability(java.lang.String type) |
(package private) java.lang.String |
getProduct() |
boolean |
is5Way() |
boolean |
isFullKeyboard() |
boolean |
isMultiTouch() |
(package private) boolean |
isQuiet()
Asks whether the device is quiet.
|
boolean |
isRelative() |
boolean |
isTouch() |
private boolean |
isTouchDeclaredAsMouse() |
private void |
readToEventBuffer() |
void |
run() |
(package private) void |
setInputProcessor(LinuxInputProcessor inputProcessor) |
java.lang.String |
toString() |
private LinuxInputProcessor inputProcessor
private java.nio.channels.ReadableByteChannel in
private long fd
private java.io.File devNode
private java.io.File sysPath
private java.util.Map<java.lang.String,java.util.BitSet> capabilities
private java.util.Map<java.lang.Integer,LinuxAbsoluteInputCapabilities> absCaps
private java.util.Map<java.lang.String,java.lang.String> udevManifest
private final java.nio.ByteBuffer event
private RunnableProcessor runnableProcessor
private LinuxInputDevice.EventProcessor processor
private final LinuxEventBuffer buffer
private java.util.Map<java.lang.String,java.lang.String> uevent
private static LinuxSystem system
LinuxInputDevice(java.io.File devNode,
java.io.File sysPath,
java.util.Map<java.lang.String,java.lang.String> udevManifest)
throws java.io.IOException
devNode - The node on which to listen for inputsysPath - The sysfs path describing the devicejava.io.IOExceptionLinuxInputDevice(java.util.Map<java.lang.String,java.util.BitSet> capabilities,
java.util.Map<java.lang.Integer,LinuxAbsoluteInputCapabilities> absCaps,
java.nio.channels.ReadableByteChannel in,
java.util.Map<java.lang.String,java.lang.String> udevManifest,
java.util.Map<java.lang.String,java.lang.String> uevent)
capabilities - Simulated capabilitiesabsCaps - Simulated absolute axis capabilitiesin - Channel f or simulated input eventsuevent - Simulated uevent datavoid setInputProcessor(LinuxInputProcessor inputProcessor)
private void readToEventBuffer()
throws java.io.IOException
java.io.IOExceptionpublic void run()
run in interface java.lang.RunnableLinuxEventBuffer getBuffer()
boolean isQuiet()
public java.lang.String toString()
toString in class java.lang.Objectjava.util.BitSet getCapability(java.lang.String type)
LinuxAbsoluteInputCapabilities getAbsoluteInputCapabilities(int axis)
java.lang.String getProduct()
public boolean isTouch()
isTouch in interface InputDeviceprivate boolean isTouchDeclaredAsMouse()
public boolean isMultiTouch()
isMultiTouch in interface InputDevicepublic boolean isRelative()
isRelative in interface InputDevicepublic boolean is5Way()
is5Way in interface InputDevicepublic boolean isFullKeyboard()
isFullKeyboard in interface InputDevice