Package com.csse3200.game.input
Class SettingsInputComponent
java.lang.Object
com.csse3200.game.components.Component
com.csse3200.game.input.InputComponent
com.csse3200.game.input.SettingsInputComponent
- All Implemented Interfaces:
com.badlogic.gdx.input.GestureDetector.GestureListener
,com.badlogic.gdx.InputProcessor
Input handler for settings menu key rebinding functionality.
-
Field Summary
Fields inherited from class com.csse3200.game.input.InputComponent
priority
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Cancel the current rebinding processboolean
Check if currently in rebinding modeboolean
keyDown
(int keycode) Handle key down events for rebindingvoid
setKeyBindButtons
(Map<String, com.badlogic.gdx.scenes.scene2d.ui.TextButton> keyBindButtons) Set the key binding buttons that this component will managevoid
startRebinding
(String actionName, com.badlogic.gdx.scenes.scene2d.ui.TextButton button) Start rebinding process for a specific actionMethods inherited from class com.csse3200.game.input.InputComponent
create, dispose, fling, getPriority, keyTyped, keyUp, longPress, mouseMoved, pan, panStop, pinch, pinchStop, pinchStopHandled, scrolled, setPriority, tap, touchCancelled, touchDown, touchDown, touchDragged, touchUp, zoom
Methods inherited from class com.csse3200.game.components.Component
earlyUpdate, getEntity, setEnabled, setEntity, toString, triggerEarlyUpdate, triggerUpdate, update
-
Constructor Details
-
SettingsInputComponent
-
-
Method Details
-
setKeyBindButtons
public void setKeyBindButtons(Map<String, com.badlogic.gdx.scenes.scene2d.ui.TextButton> keyBindButtons) Set the key binding buttons that this component will manage- Parameters:
keyBindButtons
- Map of action names to their corresponding buttons
-
startRebinding
Start rebinding process for a specific action- Parameters:
actionName
- The action to rebindbutton
- The button that was clicked
-
cancelRebinding
public void cancelRebinding()Cancel the current rebinding process -
keyDown
public boolean keyDown(int keycode) Handle key down events for rebinding- Specified by:
keyDown
in interfacecom.badlogic.gdx.InputProcessor
- Overrides:
keyDown
in classInputComponent
- Parameters:
keycode
- The key code that was pressed- Returns:
- true if the input was processed, false otherwise
- See Also:
-
isRebinding
public boolean isRebinding()Check if currently in rebinding mode- Returns:
- true if rebinding is active
-