RetroArch
Classes | Macros | Functions | Variables
dinput.c File Reference
#include <dinput.h>
#include <dbt.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <boolean.h>
#include <windowsx.h>
#include <string/stdstring.h>
#include "../input_driver.h"
#include "../input_keymaps.h"
#include "../../gfx/video_driver.h"
#include "../../configuration.h"
#include "../../verbosity.h"
Include dependency graph for dinput.c:

Classes

struct  pointer_status
 
struct  dinput_input
 

Macros

#define DIRECTINPUT_VERSION   0x0800
 
#define WM_MOUSEHWHEEL   0x20e
 
#define WM_MOUSEWHEEL   0x020A
 
#define WM_POINTERUPDATE   0x0245
 
#define WM_POINTERDOWN   0x0246
 
#define WM_POINTERUP   0x0247
 
#define GET_POINTERID_WPARAM(wParam)   (LOWORD(wParam))
 

Functions

void dinput_destroy_context (void)
 
bool dinput_init_context (void)
 
static voiddinput_init (const char *joypad_driver)
 
bool doubleclick_on_titlebar_pressed (void)
 
void unset_doubleclick_on_titlebar (void)
 
static void dinput_poll (void *data)
 
static bool dinput_keyboard_pressed (struct dinput_input *di, unsigned key)
 
static bool dinput_mbutton_pressed (struct dinput_input *di, unsigned port, unsigned key)
 
static bool dinput_is_pressed (struct dinput_input *di, rarch_joypad_info_t joypad_info, const struct retro_keybind *binds, unsigned port, unsigned id)
 
static int16_t dinput_pressed_analog (struct dinput_input *di, const struct retro_keybind *binds, unsigned idx, unsigned id)
 
static int16_t dinput_lightgun_aiming_state (struct dinput_input *di, unsigned idx, unsigned id)
 
static int16_t dinput_mouse_state (struct dinput_input *di, unsigned port, unsigned id)
 
static int16_t dinput_mouse_state_screen (struct dinput_input *di, unsigned port, unsigned id)
 
static int16_t dinput_pointer_state (struct dinput_input *di, unsigned idx, unsigned id, bool screen)
 
static int16_t dinput_input_state (void *data, rarch_joypad_info_t joypad_info, const struct retro_keybind **binds, unsigned port, unsigned device, unsigned idx, unsigned id)
 
static void dinput_pointer_store_pos (struct pointer_status *pointer, WPARAM lParam)
 
static void dinput_add_pointer (struct dinput_input *di, struct pointer_status *new_pointer)
 
static void dinput_delete_pointer (struct dinput_input *di, int pointer_id)
 
static struct pointer_statusdinput_find_pointer (struct dinput_input *di, int pointer_id)
 
static void dinput_clear_pointers (struct dinput_input *di)
 
bool dinput_handle_message (void *dinput, UINT message, WPARAM wParam, LPARAM lParam)
 
static void dinput_free (void *data)
 
static void dinput_grab_mouse (void *data, bool state)
 
static bool dinput_set_rumble (void *data, unsigned port, enum retro_rumble_effect effect, uint16_t strength)
 
static const input_device_driver_tdinput_get_joypad_driver (void *data)
 
static uint64_t dinput_get_capabilities (void *data)
 
static bool dinput_keyboard_mapping_is_blocked (void *data)
 
static void dinput_keyboard_mapping_set_block (void *data, bool value)
 

Variables

int g_xinput_pad_indexes [MAX_USERS]
 
bool g_xinput_block_pads
 
LPDIRECTINPUT8 g_dinput_ctx
 
input_driver_t input_dinput
 

Macro Definition Documentation

◆ DIRECTINPUT_VERSION

#define DIRECTINPUT_VERSION   0x0800

◆ GET_POINTERID_WPARAM

#define GET_POINTERID_WPARAM (   wParam)    (LOWORD(wParam))

◆ WM_MOUSEHWHEEL

#define WM_MOUSEHWHEEL   0x20e

◆ WM_MOUSEWHEEL

#define WM_MOUSEWHEEL   0x020A

◆ WM_POINTERDOWN

#define WM_POINTERDOWN   0x0246

◆ WM_POINTERUP

#define WM_POINTERUP   0x0247

◆ WM_POINTERUPDATE

#define WM_POINTERUPDATE   0x0245

Function Documentation

◆ dinput_add_pointer()

static void dinput_add_pointer ( struct dinput_input di,
struct pointer_status new_pointer 
)
static
Here is the caller graph for this function:

◆ dinput_clear_pointers()

static void dinput_clear_pointers ( struct dinput_input di)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_delete_pointer()

static void dinput_delete_pointer ( struct dinput_input di,
int  pointer_id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_destroy_context()

void dinput_destroy_context ( void  )
Here is the caller graph for this function:

◆ dinput_find_pointer()

static struct pointer_status* dinput_find_pointer ( struct dinput_input di,
int  pointer_id 
)
static
Here is the caller graph for this function:

◆ dinput_free()

static void dinput_free ( void data)
static
Here is the call graph for this function:

◆ dinput_get_capabilities()

static uint64_t dinput_get_capabilities ( void data)
static

◆ dinput_get_joypad_driver()

static const input_device_driver_t* dinput_get_joypad_driver ( void data)
static

◆ dinput_grab_mouse()

static void dinput_grab_mouse ( void data,
bool  state 
)
static
Here is the call graph for this function:

◆ dinput_handle_message()

bool dinput_handle_message ( void dinput,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_init()

static void* dinput_init ( const char *  joypad_driver)
static
Here is the call graph for this function:

◆ dinput_init_context()

bool dinput_init_context ( void  )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_input_state()

static int16_t dinput_input_state ( void data,
rarch_joypad_info_t  joypad_info,
const struct retro_keybind **  binds,
unsigned  port,
unsigned  device,
unsigned  idx,
unsigned  id 
)
static
Here is the call graph for this function:

◆ dinput_is_pressed()

static bool dinput_is_pressed ( struct dinput_input di,
rarch_joypad_info_t  joypad_info,
const struct retro_keybind binds,
unsigned  port,
unsigned  id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_keyboard_mapping_is_blocked()

static bool dinput_keyboard_mapping_is_blocked ( void data)
static

◆ dinput_keyboard_mapping_set_block()

static void dinput_keyboard_mapping_set_block ( void data,
bool  value 
)
static

◆ dinput_keyboard_pressed()

static bool dinput_keyboard_pressed ( struct dinput_input di,
unsigned  key 
)
static
Here is the caller graph for this function:

◆ dinput_lightgun_aiming_state()

static int16_t dinput_lightgun_aiming_state ( struct dinput_input di,
unsigned  idx,
unsigned  id 
)
static
Here is the caller graph for this function:

◆ dinput_mbutton_pressed()

static bool dinput_mbutton_pressed ( struct dinput_input di,
unsigned  port,
unsigned  key 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_mouse_state()

static int16_t dinput_mouse_state ( struct dinput_input di,
unsigned  port,
unsigned  id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_mouse_state_screen()

static int16_t dinput_mouse_state_screen ( struct dinput_input di,
unsigned  port,
unsigned  id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_pointer_state()

static int16_t dinput_pointer_state ( struct dinput_input di,
unsigned  idx,
unsigned  id,
bool  screen 
)
static
Here is the caller graph for this function:

◆ dinput_pointer_store_pos()

static void dinput_pointer_store_pos ( struct pointer_status pointer,
WPARAM  lParam 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_poll()

static void dinput_poll ( void data)
static
Here is the call graph for this function:

◆ dinput_pressed_analog()

static int16_t dinput_pressed_analog ( struct dinput_input di,
const struct retro_keybind binds,
unsigned  idx,
unsigned  id 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dinput_set_rumble()

static bool dinput_set_rumble ( void data,
unsigned  port,
enum retro_rumble_effect  effect,
uint16_t  strength 
)
static
Here is the call graph for this function:

◆ doubleclick_on_titlebar_pressed()

bool doubleclick_on_titlebar_pressed ( void  )
Here is the caller graph for this function:

◆ unset_doubleclick_on_titlebar()

void unset_doubleclick_on_titlebar ( void  )
Here is the caller graph for this function:

Variable Documentation

◆ g_dinput_ctx

LPDIRECTINPUT8 g_dinput_ctx

◆ g_xinput_block_pads

bool g_xinput_block_pads

◆ g_xinput_pad_indexes

int g_xinput_pad_indexes

◆ input_dinput

input_driver_t input_dinput
Initial value:
= {
"dinput",
}
static void dinput_free(void *data)
Definition: dinput.c:850
static int16_t dinput_input_state(void *data, rarch_joypad_info_t joypad_info, const struct retro_keybind **binds, unsigned port, unsigned device, unsigned idx, unsigned id)
Definition: dinput.c:592
static void * dinput_init(const char *joypad_driver)
Definition: dinput.c:140
static bool dinput_set_rumble(void *data, unsigned port, enum retro_rumble_effect effect, uint16_t strength)
Definition: dinput.c:894
#define NULL
Pointer to 0.
Definition: gctypes.h:65
static const input_device_driver_t * dinput_get_joypad_driver(void *data)
Definition: dinput.c:903
static void dinput_grab_mouse(void *data, bool state)
Definition: dinput.c:881
static void dinput_keyboard_mapping_set_block(void *data, bool value)
Definition: dinput.c:933
static bool dinput_keyboard_mapping_is_blocked(void *data)
Definition: dinput.c:925
static void dinput_poll(void *data)
Definition: dinput.c:210
static uint64_t dinput_get_capabilities(void *data)
Definition: dinput.c:911