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

Go to the source code of this file.

Data Structures

struct  di_joy_state

Macros

#define DINPUT_POV_CENTERED   0xFFFFFFFF
#define DINPUT_BUTTON_PRESSED   0x80

Enumerations

enum  { DTTR_DINPUT_AXIS_SCALE = 32 , DTTR_DINPUT_AXIS_FULL_DEFLECTION = 1000 }

Functions

static void init_poll_state (di_joy_state *state)
static void apply_direction_state (di_joy_state *state, bool dir_up, bool dir_down, bool dir_left, bool dir_right)
static bool is_source_pressed (int source)
static LONG read_axis (int axis_idx)
voiddttr_inputs_hook_dinput_poll_callback (void *device)

Macro Definition Documentation

◆ DINPUT_BUTTON_PRESSED

#define DINPUT_BUTTON_PRESSED   0x80

Definition at line 33 of file hook_dinput_poll.c.

Referenced by dttr_inputs_hook_dinput_poll_callback().

◆ DINPUT_POV_CENTERED

#define DINPUT_POV_CENTERED   0xFFFFFFFF

Definition at line 31 of file hook_dinput_poll.c.

Referenced by init_poll_state().

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DTTR_DINPUT_AXIS_SCALE 
DTTR_DINPUT_AXIS_FULL_DEFLECTION 

Definition at line 26 of file hook_dinput_poll.c.

Function Documentation

◆ apply_direction_state()

void apply_direction_state ( di_joy_state * state,
bool dir_up,
bool dir_down,
bool dir_left,
bool dir_right )
static

Definition at line 43 of file hook_dinput_poll.c.

References DTTR_DINPUT_AXIS_FULL_DEFLECTION, and state.

Referenced by dttr_inputs_hook_dinput_poll_callback().

◆ dttr_inputs_hook_dinput_poll_callback()

◆ init_poll_state()

void init_poll_state ( di_joy_state * state)
static

Definition at line 35 of file hook_dinput_poll.c.

References DINPUT_POV_CENTERED, and state.

Referenced by dttr_inputs_hook_dinput_poll_callback().

◆ is_source_pressed()

◆ read_axis()

LONG read_axis ( int axis_idx)
static