public class HudKeyListener
extends java.lang.Object
implements java.awt.event.KeyListener
Modifier and Type | Field and Description |
---|---|
static artisynth.core.renderables.HudKeyListener.KeyCombo |
defaultFullscreenKeys |
static artisynth.core.renderables.HudKeyListener.KeyCombo |
defaultScrollDownKeys |
static artisynth.core.renderables.HudKeyListener.KeyCombo |
defaultScrollUpKeys |
Constructor and Description |
---|
HudKeyListener(HudPrintStream hud)
Creates a key listener for a HudPrintStream object
|
HudKeyListener(HudPrintStream hud,
GLViewer viewer)
Creates a key listener for a HudPrintStream object
|
Modifier and Type | Method and Description |
---|---|
static HudKeyListener |
createListener(HudPrintStream hud,
java.awt.Component comp)
Creates and registers a HudKeyListener object
|
static HudKeyListener |
createListener(HudPrintStream hud,
GLViewer viewer)
Creates and registers a HudKeyListener object
|
void |
keyPressed(java.awt.event.KeyEvent e) |
void |
keyReleased(java.awt.event.KeyEvent e) |
void |
keyTyped(java.awt.event.KeyEvent e) |
void |
setFullscreenCombo(int keyCode,
char keyChar,
int keyModifiers)
Set key combination for toggling fullscreen, executed in the keyTyped
event.
|
void |
setScrollDownCombo(int keyCode,
char keyChar,
int keyModifiers)
Set key combination for scrolling down, executed in the keyPressed event.
|
void |
setScrollUpCombo(int keyCode,
char keyChar,
int keyModifiers)
Set key combination for scrolling up, executed in the keyPressed event.
|
public static artisynth.core.renderables.HudKeyListener.KeyCombo defaultScrollUpKeys
public static artisynth.core.renderables.HudKeyListener.KeyCombo defaultScrollDownKeys
public static artisynth.core.renderables.HudKeyListener.KeyCombo defaultFullscreenKeys
public HudKeyListener(HudPrintStream hud)
hud
- the HudPrintStream object to controlpublic HudKeyListener(HudPrintStream hud, GLViewer viewer)
hud
- the HudPrintStream object to controlviewer
- (optional) a viewer used to trigger re-render events after changespublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent e)
keyReleased
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent e)
keyTyped
in interface java.awt.event.KeyListener
public void setScrollUpCombo(int keyCode, char keyChar, int keyModifiers)
keyCode
- numeric codekeyChar
- (optional) characterkeyModifiers
- modifierspublic void setScrollDownCombo(int keyCode, char keyChar, int keyModifiers)
keyCode
- numeric codekeyChar
- (optional) characterkeyModifiers
- modifierspublic void setFullscreenCombo(int keyCode, char keyChar, int keyModifiers)
keyCode
- numeric codekeyChar
- (optional) characterkeyModifiers
- modifierspublic static HudKeyListener createListener(HudPrintStream hud, java.awt.Component comp)
hud
- the HudPrintStream to controlcomp
- the component on which to listen for key eventspublic static HudKeyListener createListener(HudPrintStream hud, GLViewer viewer)
hud
- the HudPrintStream to controlviewer
- the component on which to listen for key events/re-render