102 Patches: Detours to the Rescue
C reference for DttR maintainers and modders.
Loading...
Searching...
No Matches
inputs.c File Reference
#include <SDL3/SDL.h>
#include <dttr_pcdogs.h>
#include "hooks_private.h"
#include "inputs_private.h"
#include "sidecar_private.h"
#include <dttr_config.h>
#include <dttr_log.h>

Go to the source code of this file.

Functions

static bool set_joystick_available (int32_t available)
static bool try_open_configured_gamepad ()
static void close_gamepad ()
void dttr_inputs_init ()
bool dttr_inputs_hooks_init (const DTTR_Mods_Context *ctx)
void dttr_inputs_handle_device_event (const SDL_Event *event)
bool dttr_inputs_late_init ()
void dttr_inputs_hooks_cleanup (const DTTR_Mods_Context *ctx)
void dttr_inputs_cleanup ()

Variables

SDL_Gamepad * dttr_inputs_gamepad
static DTTR_Core_PatchGroupinputs_targets

Function Documentation

◆ close_gamepad()

void close_gamepad ( )
static

Definition at line 56 of file inputs.c.

References dttr_inputs_gamepad, NULL, and set_joystick_available().

Referenced by dttr_inputs_cleanup(), and dttr_inputs_handle_device_event().

◆ dttr_inputs_cleanup()

void dttr_inputs_cleanup ( )

Definition at line 172 of file inputs.c.

References close_gamepad().

Referenced by cleanup_runtime().

◆ dttr_inputs_handle_device_event()

◆ dttr_inputs_hooks_cleanup()

void dttr_inputs_hooks_cleanup ( const DTTR_Mods_Context * ctx)

Definition at line 168 of file inputs.c.

References ctx, DTTR_Core_PatchGroupRelease(), and inputs_targets.

Referenced by cleanup_runtime().

◆ dttr_inputs_hooks_init()

◆ dttr_inputs_init()

void dttr_inputs_init ( )

Definition at line 66 of file inputs.c.

References dttr_config, DTTR_LOG_ERROR, and try_open_configured_gamepad().

Referenced by install_required_sidecar_hooks().

◆ dttr_inputs_late_init()

bool dttr_inputs_late_init ( )

◆ set_joystick_available()

bool set_joystick_available ( int32_t available)
static

◆ try_open_configured_gamepad()

bool try_open_configured_gamepad ( )
static

Variable Documentation

◆ dttr_inputs_gamepad

◆ inputs_targets

DTTR_Core_PatchGroup* inputs_targets
static

Definition at line 13 of file inputs.c.

Referenced by dttr_inputs_hooks_cleanup(), and dttr_inputs_hooks_init().