|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--usb.linux.HID
Simple Linux-specific HID access, using the kernel hid and evdev driver modules. If you have both of those modules loaded, you may use this class; if neither is loaded, you may be able to write a pure Java HID driver; otherwise, you can't currently access HID devices.
This is experimental, and its documentation and functionality is known to be incomplete. Experiment! You'll likely want the HID spec in hand.
Nested Class Summary | |
static class |
HID.Event
Encapsulates HID i/o event reports. |
Constructor Summary | |
HID(Device dev)
Constructs a HID object associated with the device's single HID interface. |
|
HID(Interface intf)
Constructs a HID object associated with a given interface. |
Method Summary | |
void |
close()
Closes the underlying "event device" file handle |
static void |
main(java.lang.String[] argv)
|
HID.Event |
readEvent()
Blocks until an input event is reported. |
void |
sendEvent(HID.Event event)
Sends an event (not repeated). |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HID(Device dev) throws java.io.IOException
java.lang.IllegalArgumentException
- if the device doesn't
have exactly one HID interface, or it's not claimed by the
kernel HID driver
java.io.IOException
- if it can't find the input device
or has difficulty examining the device configurationpublic HID(Interface intf) throws java.io.IOException
java.lang.IllegalArgumentException
- if the interface is
not claimed by the kernel HID driver
java.io.IOException
- if it can't find the input deviceMethod Detail |
public void close()
public void sendEvent(HID.Event event) throws java.io.IOException
java.io.IOException
public HID.Event readEvent() throws java.io.IOException
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] argv)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |