public class KeyManager
extends java.lang.Object
The KeyManager
class provides static methods to retrieve a list
of available InoutDevices
.
Modifier and Type | Method and Description |
---|---|
static void |
addInputDeviceListener(InputDeviceListener l)
Adds an InputDevice listener to receive InputDevice notifications.
|
static java.util.Iterator<InputDevice> |
getHeadlessInputDevices()
Returns an iterator over all "headless" input devices
currently attached to the device, like independent keypads or button
fields.
|
static java.util.Iterator<InputDevice> |
getInputDevices()
Returns an iterator over all input devices currently attached to the
device.
|
static void |
removeInputDeviceListener(InputDeviceListener l)
Removes a previously added InputDevice listener.
|
static void |
setGeneralKeyListener(KeyListener listener)
Sets a
KeyListener for key events to all InputDevices available in the recent runtime environment, replacing
any previous KeyListener set to any of those
InputDevices , if any. |
public static java.util.Iterator<InputDevice> getInputDevices()
public static java.util.Iterator<InputDevice> getHeadlessInputDevices()
getInputDevices()
.public static void setGeneralKeyListener(KeyListener listener)
KeyListener
for key events to all InputDevices
available in the recent runtime environment, replacing
any previous KeyListener
set to any of those
InputDevices
, if any. A null
reference is allowed and has the effect of removing any existing
listener for all input devices.
listener
- the new listener, or null
to remove all listeners.public static void addInputDeviceListener(InputDeviceListener l)
InputDevices
.l
- the new listener to be addedjava.lang.NullPointerException
- if the listener is nullpublic static void removeInputDeviceListener(InputDeviceListener l)
l
- the listener to be removedjava.lang.NullPointerException
- if the listener is nullCopyright (c) 2014, Oracle and/or its affiliates. All rights reserved. Use of this specification is subject to license terms.