Interface KeyboardInputHandler
- All Known Implementing Classes:
GuiComponent,TextEditComponent,WorldNavigationUserInputTracker
public interface KeyboardInputHandler
This is the process:
1. Component receives focus, perhaps because user clicked on it with the mouse. 2. Now component will receive user key press and release events from the keyboard. 3. Component loses focus. Perhaps user chose another component to interact with.
-
Method Summary
Modifier and TypeMethodDescriptionbooleanCalled when the component loses keyboard focus.booleanfocusReceived(ViewPanel viewPanel) Called when the component receives keyboard focus.booleankeyPressed(KeyEvent event, ViewPanel viewPanel) Called when a key is pressed while the component has focus.booleankeyReleased(KeyEvent event, ViewPanel viewPanel) Called when a key is released while the component has focus.
-
Method Details
-
focusLost
Called when the component loses keyboard focus.- Parameters:
viewPanel- the view panel that owns this handler- Returns:
trueif view needs to be re-rendered
-
focusReceived
Called when the component receives keyboard focus.- Parameters:
viewPanel- the view panel that owns this handler- Returns:
trueif view needs to be re-rendered
-
keyPressed
Called when a key is pressed while the component has focus.- Parameters:
event- the key eventviewPanel- the view panel that owns this handler- Returns:
trueif view needs to be re-rendered
-
keyReleased
Called when a key is released while the component has focus.- Parameters:
event- the key eventviewPanel- the view panel that owns this handler- Returns:
trueif view needs to be re-rendered
-