Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update vehicle hotkeys #148

Merged
merged 3 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1489,8 +1489,8 @@ MonoBehaviour:
throttleAndBrakeAxis: Vertical
handbrakeAxis: Jump
clutchAxis: Fire1
gearShiftButton: Fire2
gearModeSelectButton: Fire3
gearShiftButton: GearShift
gearModeSelectButton: GearMode
keyboardNumbersSelectGears: 0
neutralGear: 110
reverseGear: 114
Expand Down
71 changes: 48 additions & 23 deletions Assets/AWSIM/Resources/Hotkeys.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,49 @@
{
"keyBinds": [
{
"name": "VehicleKeyboardInput.cs",
"name": "Vehicle Controller",
"hotkeys": [
{
"key": "Up Arrow",
"description": "Accelerate"
"key": "W / Up Arrow",
"description": "Throttle"
},
{
"key": "Left Arrow",
"description": "Steer Left"
"key": "S / Down Arrow",
"description": "Brake"
},
{
"key": "Right Arrow",
"description": "Steer Right"
"key": "A / Left Arrow",
"description": "Steer Left"
},
{
"key": "Down Arrow",
"description": "Brake"
"key": "D / Right Arrow",
"description": "Steer Right"
},
{
"key": "D",
"description": "Gear: Drive"
"key": "Space",
"description": "Handbrake"
},
{
"key": "P",
"description": "Gear: Parking"
"key": "Left Shift / Left Ctrl",
"description": "Change Gear +/-"
},
{
"key": "R",
"description": "Gear: Reverse"
"description": "Reverse Gear"
},
{
"key": "N",
"description": "Gear: Neutral"
"description": "Neutral Gear"
},
{
"key": "Left Alt",
"description": "Change Gear Mode"
}
]
},
{
"name": "VPPVehicleSignalHandler.cs",
"hotkeys": [
{
"key": "1",
"description": "Signal: Left"
Expand All @@ -54,19 +63,35 @@
]
},
{
"name": "FollowCamera.cs",
"name": "Camera Controller",
"hotkeys": [
{
"key": "C",
"description": "Camera control toggle"
"description": "Toggle camera mode"
},
{
"key": "Mouse Drag",
"description": "Camera rotation (in certain modes)"
},
{
"key": "Mouse Wheel +/-",
"description": "Camera zoom (in certain modes)"
},
{
"key": "Hold LShift + Mouse Drag",
"description": "Camera rotation"
"key": "F1",
"description": "Camera mode: Driver View"
},
{
"key": "F2",
"description": "Camera mode: Smooth Follow"
},
{
"key": "F3",
"description": "Camera Mode: Orbit"
},
{
"key": "Hold LShift + Mouse Wheel +/-",
"description": "Camera zoom"
"key": "F4",
"description": "Camera Mode: Look At"
}
]
},
Expand Down Expand Up @@ -126,11 +151,11 @@
]
},
{
"name": "Scene Loader",
"name": "Loader.cs",
"hotkeys": [
{
"key": "F12",
"description": "Reload the scene"
"description": "Go back to the load scene / Reload"
}
]
}
Expand Down
21 changes: 11 additions & 10 deletions ProjectSettings/InputManager.asset
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ InputManager:
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire2
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: left alt
m_Name: GearShift
descriptiveName: Gear shift up
descriptiveNegativeName: Gear shift down
negativeButton: left ctrl
positiveButton: left shift
altNegativeButton:
altPositiveButton: mouse 1
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
Expand All @@ -70,13 +70,13 @@ InputManager:
axis: 0
joyNum: 0
- serializedVersion: 3
m_Name: Fire3
descriptiveName:
m_Name: GearMode
descriptiveName: Change gear mode
descriptiveNegativeName:
negativeButton:
positiveButton: left shift
positiveButton: left alt
altNegativeButton:
altPositiveButton: mouse 2
altPositiveButton:
gravity: 1000
dead: 0.001
sensitivity: 1000
Expand Down Expand Up @@ -485,3 +485,4 @@ InputManager:
type: 2
axis: 5
joyNum: 0
m_UsePhysicalKeys: 1
66 changes: 40 additions & 26 deletions docs/ProjectGuide/HotkeyList/index.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
# Hotkey List

### [VehicleKeyboardInput.cs](https://github.com/autowarefoundation/AWSIM-Labs/blob/main/Assets/AWSIM/Scripts/Vehicles/VehicleKeyboardInput.cs)

| Key | Feature |
|:------------|:-------------------|
| D | Change drive gear. |
| P | Parking gear. |
| R | Reverse gear. |
| N | Neutral gear. |
| 1 | Left turn signal. |
| 2 | Right turn signal. |
| 3 | Hazard. |
| 4 | Turn signal off. |
| Up arrow | Accelerate. |
| Left arrow | Steering (Left). |
| Right arrow | Steering (Right). |
| Down arrow | Breaking. |

W,A,S,D keys can also be used to control the vehicle, similar to the arrow keys.

### [FollowCamera.cs](https://github.com/autowarefoundation/AWSIM-Labs/blob/main/Assets/AWSIM/Scripts/FollowCamera.cs)

| Key | Feature |
|:------------|:-------------------------------|
| C | Camera rotation on/off toggle. |
| Mouse drag | Rotate Camera angle. |
| Mouse wheel | Zoom in/out of camera. |
### Vehicle Controller

| Key | Feature |
|:-----------------------|:------------------|
| W / Up Arrow | Throttle. |
| S / Down Arrow | Brake. |
| A / Left Arrow | Steer Left. |
| D / Right Arrow | Steer Right. |
| Space | Handbrake. |
| Left Shift / Left Ctrl | Change Gear +/-. |
| R | Reverse Gear. |
| N | Neutral Gear. |
| Left Alt | Change Gear Mode. |

### [VPPVehicleSignalHandler.cs](https://github.com/autowarefoundation/AWSIM-Labs/blob/main/Assets/AWSIM/Scripts/Vehicles/VPP%20Integration/VPPVehicleSignalHandler.cs)

| Key | Feature |
|:----|:----------------|
| 1 | Signal: Left. |
| 2 | Signal: Right. |
| 3 | Signal: Hazard. |
| 4 | Signal: Off. |

### Camera Controller

| Key | Feature |
|:----------------|:------------------------------------|
| C | Toggle camera mode. |
| Mouse Drag | Camera rotation (in certain modes). |
| Mouse Wheel +/- | Camera zoom (in certain modes) |
| F1 | Camera Mode: Driver View. |
| F2 | Camera Mode: Smooth Follow. |
| F3 | Camera Mode: Orbit. |
| F4 | Camera Mode: Look At. |

### [HotkeyHandler.cs](https://github.com/autowarefoundation/AWSIM-Labs/blob/main/Assets/AWSIM/Scripts/UI/HotkeyHandler.cs)

Expand All @@ -51,3 +59,9 @@ W,A,S,D keys can also be used to control the vehicle, similar to the arrow keys.
| Key | Feature |
|:----|:-------------------------|
| F3 | Toggle Graphy Visualizer |

### [Loader.cs](https://github.com/autowarefoundation/AWSIM-Labs/blob/main/Assets/AWSIM/Scripts/Loader/Loader.cs)

| Key | Feature |
|:----|:--------------------------------|
| F12 | Go back to load scene / Reload. |
Loading