Controls, Commands & Actions - photonle/Photon-v2 GitHub Wiki

Photon 2 uses a very modular user input (key-binding) system. While offering a basic and familiar user experience for most players, advanced users are able to make multiple custom input configurations, assign different input profiles to different vehicles, use one or more modifier keys, and create custom commands to precisely adjust controller channels and modes as desired.

Default Controls


  • F: Toggle warning lights (MODE2)
  • R: Toggle siren, activate warning lights (MODE3)
  • L ALT: Cycle through warning lights modes (MODE1, MODE2, MODE3)
  • M: Toggle marker/cruise lights.
  • N: Short press toggles Auxiliary MODE1. Long press toggles Auxiliary MODE2.
  • 1-8: Toggle siren tones T1-T8
  • H: Quick press toggles headlights. Long press toggles parking lights.
  • RAlt + H: Activates automatic headlights and daytime running lights. (On by default.)

  • Arrow LEFT: Toggle left turn signal.
  • Arrow RIGHT: Toggle right turn signal.
  • Arrow UP: Toggle hazard lights.
  • Arrow DOWN: All turn signals off.

  • RCtrl + Arrow LEFT: Toggle traffic advisor left.
  • RCtrl + Arrow RIGHT: Toggle traffic advisor right.
  • RCtrl + Arrow UP: Toggle traffic advisor center-out.
  • RCtrl + Arrow DOWN: Turn directional/traffic advisor off.

  • RShift + Arrow LEFT: Toggle left scene lighting.
  • RShift + Arrow RIGHT: Toggle right scene lighting.
  • RShift + Arrow UP: Toggle forward scene lighting.
  • RShift + Arrow DOWN: Turn all scene lighting off.

  • MOUSE1: Airhorn (momentary).
  • MOUSE2: Manual siren (momentary).

Input Configurations

Due to the volume of functions available in Photon 2 -- along with user preference and risk of conflict with other addons -- Photon 2 supports different input configuration profiles. Each profile can use completely unique key binds, and may be mapped to specific vehicles or used as a user's global default. Configuration profiles can be adjusted or swapped around at any time.

Photon 2 comes with different input configuration profiles as is, but new ones can also be created by a user, supplied by a server, or packaged with any addon.

Input configurations not created by the user are technically "locked" (as they are configured in Lua code). However, a user is able to copy or inherit from that profile and modify any aspect.

User-modified configurations are only stored locally.

Available Default Profiles

Default (User)

The "Default (User)" profile is used by default when Photon 2 is initially installed. It is a copy of the "Default" input configuration that the user is able to modify.

Alternate

The "Alternate" profile is specifically designed to not conflict with VCMod's default controls.

Always Use MODE3

This is a special profile made per user request. It is identical to Default, but jumps MODE3 when the lights are activated.

Classic (Photon LE)

The Classic profile mimics the default controls from Photon LE.

Customizing Key Binds

Basic

Key binding can be adjusted in-game using the Input Configuration window. (In Sandbox-based gamemodes, hold C, open menu titled Photon 2 at very top of screen, then select Open Input Settings.) The window should be sufficient for most users to customize

Modifier Keys

Modifier keys are additional buttons that must be pressed in combination with a primary button in order to execute a command. For example, in the common Ctrl+C keyboard shortcut, C is the primary key while Ctrl is the modifier key. In most desktop applications, modifier keys are normally Control, Alt, and Shift.

(Note that the actual order/sequence of modifier keys is irrelevant. A command will be triggered whenever all corresponding keys are pressed simultaneously.)

Photon 2 supports this approach, and is even able to distinguish between the left and right modifier keys (e.g. ALT vs R ALT). There is also no limitation on what a modifier key can be. A J+K combination, for example, is supported. You may also require multiple modifier keys, allowing for combinations like Shift+Ctrl+A or Shift+Control+Alt+A (see the advanced section below for more on this).

Advanced

As noted previously, Photon 2 has a comprehensive and fully-modular input system (which is somewhat intentionally obscured to avoid confusing casual users). Unlike most input-binding schemes, Photon 2 allows for a "many-to-many" relationship between buttons and commands. That means one button can execute multiple commands, and one command can be executed by multiple buttons.

Furthermore, each command can be assigned one or more modifier buttons

Commands

Commands are one or more customizable actions that manipulate the state and behavior of a Photon Controller. Some commands toggle a function on/off (e.g. emergency warning lights), some cycle through available modes (e.g. setting MODE1, then MODE2, then MODE3, then back to MODE1 with each press).

Library

Commands are part of Photon 2's library system and are located at lua/photon-v2/library/commands. This allows them to be shared, exported, or packaged with a standalone addon.

Queries

Queries interface with a Photon profile/vehicle's input schema. They are utilized to make actions dynamic and automatically adjust their behavior based on the detected capabilities of the current profile/vehicle. For example, they can accommodate when a profile/vehicle uses only one light stage as opposed to the standard of three. Conversely, they can adapt if the a profile/vehicle uses four.

Key Activities

Key activities are button events, which allows for different actions to be executed depending on the event.

OnPress

Immediately triggered as soon as a button in pressed.

OnHold

Triggered after the button was pressed and held for approximately one second.

OnRelease

Triggered when the button is released or lifted.

Actions

Actions are pre-built, hard-coded functions a player can reference and configure parameters for. They perform specific adjustments to channels and can be stacked with other actions inside of a Command.

"OFF_TOGGLE"

"ON_TOGGLE"

"SET"

"TOGGLE"

"CYCLE"

"SOUND"

Triggers an interaction sound based on the specified sound class (usually Controller or Click) and the activating key activity (press, hold, or release). The sound may be suppressed if the user's Interaction Sound Profile is configured to ignore it. (See the Interaction Sounds page for an explanation of this).