> For the complete documentation index, see [llms.txt](https://davedev.gitbook.io/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://davedev.gitbook.io/wiki/immersive-flashlight/player-guide-and-controls.md).

# Player Guide & Controls

## Keybinds & Commands

DaveDev Flashlight has two FiveM keybind entries by default:

* Equip or holster the flashlight
* Toggle the flashlight beam while it is equipped

Players can change these in FiveM's keybinding menu.

### Default Keybinds List

| Action                     |   Default key  | FiveM binding label                | Internal command     | Config location          |
| -------------------------- | :------------: | ---------------------------------- | -------------------- | ------------------------ |
| Equip / holster flashlight |      **O**     | `Equip or holster your Flashlight` | `flashlight_keybind` | `commands.equip.keybind` |
| Toggle flashlight beam     | `Middle Mouse` | `Toggle your Flashlight beam`      | `flashlight_toggle`  | `commands.toggleLight`   |

{% hint style="info" %}
The `flashlight_keybind` command is mainly used by FiveM's key mapping system. Players normally use the keybind or `/flashlight`.
{% endhint %}

### Command List

| Command              | Default state            | Description                                                                                                                                             |
| -------------------- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `/flashlight`        | Enabled                  | Equips or holsters the flashlight. If item checks are enabled and a supported inventory is active, the player must have the configured flashlight item. |
| `/flashlight_toggle` | Enabled                  | Toggles the beam on or off while the flashlight is equipped.                                                                                            |
| `/flashlight_debug`  | Disabled (Developer Use) | Prints setup and framework adapter diagnostics. Enable with `debugTools.enabled = true` or `debug = true`.                                              |

#### Admin Debug Command

The debug command is disabled by default.

```lua
debugTools = {
  enabled = false,
  command = 'flashlight_debug',
  ace = { 'group.admin', 'qbcore.god' },
}
```

When enabled, `/flashlight_debug` reports detected frameworks, inventory adapters, configured item names, resource states, and bridge setup hints.

Set `debugAutoDetection = true` to print only framework/bridge auto-detection logs while leaving `debug = false`. This is specifically useful for those who may have a hybrid/constantly changing framework/invetory setup and might want to monitor the status of the resource.

#### Gameplay Controls

These controls are active while the flashlight is equipped. They are normal GTA/FiveM controls rather than separate key-binding entries.

| Action                                                                      | Default control          | Config value                  |
| --------------------------------------------------------------------------- | ------------------------ | ----------------------------- |
| Hold to let the camera fully drive the flashlight beam and prop direction   | Aim / Right Mouse Button | `controls.followControl = 25` |
| Widen the beam cone; this reduces effective brightness/distance for balance | Mouse Wheel Up           | `controls.coneIncrease = 241` |
| Narrow the beam cone; this increases effective brightness/distance          | Mouse Wheel Down         | `controls.coneDecrease = 242` |

### How Players Change The Keybind

1. Join a server where `DaveDev_Flashlight` is running.
2. Press `Esc`.
3. Open **Settings**.
4. Open **Key Bindings**.
5. Select the **FiveM** tab/category.
6. Find one of these entries:

* `"DaveDev_Flashlight"` as the resource name, or
* `"Equip or holster your Flashlight"` and/or `"Toggle your Flashlight beam"`

1. Click the binding slot.
2. Press a key or mouse button you want to use whilst the area is highlighted.
3. Back out of the menu to save the change.

{% hint style="warning" %}
If another resource or GTA control already uses a key, FiveM may warn about the conflict. Pick another key or clear the old binding first.

If you have issues getting the keybind area to highlight, unplug any controllers or external hardware (flightsticks, wheels, pedals, etc.) that may be inputting a signal from minor stick drift.
{% endhint %}

### Server Config

The default command and keybind settings are in `DaveDev_Flashlight/config.lua`.

```lua
commands = {
  equip = {
    enabled = true,
    name = 'flashlight',
    description = 'Equip or holster your Flashlight',
    suggestion = '/flashlight - Equip or holster your Flashlight',

    keybind = {
      enabled = true,
      command = 'flashlight_keybind',
      description = 'Equip or holster your Flashlight',
      mapper = 'keyboard',
      key = 'O',
      registerKeyMapping = true,
    },
  },

  toggleLight = {
    enabled = true,
    name = 'flashlight_toggle',
    description = 'Toggle your Flashlight beam',
    key = 'MOUSE_MIDDLE',
    registerKeyMapping = true,
  },
}
```
