📄 dinputd.h
字号:
/****************************************************************************
*
* Copyright (C) 1995-2000 Microsoft Corporation. All Rights Reserved.
*
* File: dinputd.h
* Content: DirectInput include file for device driver implementors
*
****************************************************************************/
#ifndef __DINPUTD_INCLUDED__
#define __DINPUTD_INCLUDED__
#ifndef DIRECTINPUT_VERSION
#define DIRECTINPUT_VERSION 0x0800
#pragma message(__FILE__ ": DIRECTINPUT_VERSION undefined. Defaulting to version 0x0800")
#endif
#ifdef __cplusplus
extern "C" {
#endif
/****************************************************************************
*
* Interfaces
*
****************************************************************************/
#ifndef DIJ_RINGZERO
DEFINE_GUID(IID_IDirectInputEffectDriver, 0x02538130,0x898F,0x11D0,0x9A,0xD0,0x00,0xA0,0xC9,0xA0,0x6E,0x35);
DEFINE_GUID(IID_IDirectInputJoyConfig, 0x1DE12AB1,0xC9F5,0x11CF,0xBF,0xC7,0x44,0x45,0x53,0x54,0x00,0x00);
DEFINE_GUID(IID_IDirectInputPIDDriver, 0xEEC6993A,0xB3FD,0x11D2,0xA9,0x16,0x00,0xC0,0x4F,0xB9,0x86,0x38);
DEFINE_GUID(IID_IDirectInputJoyConfig8, 0xeb0d7dfa,0x1990,0x4f27,0xb4,0xd6,0xed,0xf2,0xee,0xc4,0xa4,0x4c);
#endif /* DIJ_RINGZERO */
/****************************************************************************
*
* IDirectInputEffectDriver
*
****************************************************************************/
typedef struct DIOBJECTATTRIBUTES {
DWORD dwFlags;
WORD wUsagePage;
WORD wUsage;
} DIOBJECTATTRIBUTES, *LPDIOBJECTATTRIBUTES;
typedef const DIOBJECTATTRIBUTES *LPCDIOBJECTATTRIBUTES;
typedef struct DIFFOBJECTATTRIBUTES {
DWORD dwFFMaxForce;
DWORD dwFFForceResolution;
} DIFFOBJECTATTRIBUTES, *LPDIFFOBJECTATTRIBUTES;
typedef const DIFFOBJECTATTRIBUTES *LPCDIFFOBJECTATTRIBUTES;
typedef struct DIOBJECTCALIBRATION {
LONG lMin;
LONG lCenter;
LONG lMax;
} DIOBJECTCALIBRATION, *LPDIOBJECTCALIBRATION;
typedef const DIOBJECTCALIBRATION *LPCDIOBJECTCALIBRATION;
typedef struct DIPOVCALIBRATION {
LONG lMin[5];
LONG lMax[5];
} DIPOVCALIBRATION, *LPDIPOVCALIBRATION;
typedef const DIPOVCALIBRATION *LPCDIPOVCALIBRATION;
typedef struct DIEFFECTATTRIBUTES {
DWORD dwEffectId;
DWORD dwEffType;
DWORD dwStaticParams;
DWORD dwDynamicParams;
DWORD dwCoords;
} DIEFFECTATTRIBUTES, *LPDIEFFECTATTRIBUTES;
typedef const DIEFFECTATTRIBUTES *LPCDIEFFECTATTRIBUTES;
typedef struct DIFFDEVICEATTRIBUTES {
DWORD dwFlags;
DWORD dwFFSamplePeriod;
DWORD dwFFMinTimeResolution;
} DIFFDEVICEATTRIBUTES, *LPDIFFDEVICEATTRIBUTES;
typedef const DIFFDEVICEATTRIBUTES *LPCDIFFDEVICEATTRIBUTES;
typedef struct DIDRIVERVERSIONS {
DWORD dwSize;
DWORD dwFirmwareRevision;
DWORD dwHardwareRevision;
DWORD dwFFDriverVersion;
} DIDRIVERVERSIONS, *LPDIDRIVERVERSIONS;
typedef const DIDRIVERVERSIONS *LPCDIDRIVERVERSIONS;
typedef struct DIDEVICESTATE {
DWORD dwSize;
DWORD dwState;
DWORD dwLoad;
} DIDEVICESTATE, *LPDIDEVICESTATE;
#define DEV_STS_EFFECT_RUNNING DIEGES_PLAYING
#ifndef DIJ_RINGZERO
typedef struct DIHIDFFINITINFO {
DWORD dwSize;
LPWSTR pwszDeviceInterface;
GUID GuidInstance;
} DIHIDFFINITINFO, *LPDIHIDFFINITINFO;
#undef INTERFACE
#define INTERFACE IDirectInputEffectDriver
DECLARE_INTERFACE_(IDirectInputEffectDriver, IUnknown)
{
/*** IUnknown methods ***/
STDMETHOD(QueryInterface)(THIS_ REFIID riid, LPVOID * ppvObj) PURE;
STDMETHOD_(ULONG,AddRef)(THIS) PURE;
STDMETHOD_(ULONG,Release)(THIS) PURE;
/*** IDirectInputEffectDriver methods ***/
STDMETHOD(DeviceID)(THIS_ DWORD,DWORD,DWORD,DWORD,LPVOID) PURE;
STDMETHOD(GetVersions)(THIS_ LPDIDRIVERVERSIONS) PURE;
STDMETHOD(Escape)(THIS_ DWORD,DWORD,LPDIEFFESCAPE) PURE;
STDMETHOD(SetGain)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(SendForceFeedbackCommand)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(GetForceFeedbackState)(THIS_ DWORD,LPDIDEVICESTATE) PURE;
STDMETHOD(DownloadEffect)(THIS_ DWORD,DWORD,LPDWORD,LPCDIEFFECT,DWORD) PURE;
STDMETHOD(DestroyEffect)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(StartEffect)(THIS_ DWORD,DWORD,DWORD,DWORD) PURE;
STDMETHOD(StopEffect)(THIS_ DWORD,DWORD) PURE;
STDMETHOD(GetEffectStatus)(THIS_ DWORD,DWORD,LPDWORD) PURE;
};
typedef struct IDirectInputEffectDriver *LPDIRECTINPUTEFFECTDRIVER;
#if !defined(__cplusplus) || defined(CINTERFACE)
#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define IDirectInputEffectDriver_AddRef(p) (p)->lpVtbl->AddRef(p)
#define IDirectInputEffectDriver_Release(p) (p)->lpVtbl->Release(p)
#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->lpVtbl->DeviceID(p,a,b,c,d,e)
#define IDirectInputEffectDriver_GetVersions(p,a) (p)->lpVtbl->GetVersions(p,a)
#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->lpVtbl->Escape(p,a,b,c)
#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->lpVtbl->SetGain(p,a,b)
#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->lpVtbl->SendForceFeedbackCommand(p,a,b)
#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->lpVtbl->GetForceFeedbackState(p,a,b)
#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->lpVtbl->DownloadEffect(p,a,b,c,d,e)
#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->lpVtbl->DestroyEffect(p,a,b)
#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->lpVtbl->StartEffect(p,a,b,c,d)
#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->lpVtbl->StopEffect(p,a,b)
#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->lpVtbl->GetEffectStatus(p,a,b,c)
#else
#define IDirectInputEffectDriver_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
#define IDirectInputEffectDriver_AddRef(p) (p)->AddRef()
#define IDirectInputEffectDriver_Release(p) (p)->Release()
#define IDirectInputEffectDriver_DeviceID(p,a,b,c,d,e) (p)->DeviceID(a,b,c,d,e)
#define IDirectInputEffectDriver_GetVersions(p,a) (p)->GetVersions(a)
#define IDirectInputEffectDriver_Escape(p,a,b,c) (p)->Escape(a,b,c)
#define IDirectInputEffectDriver_SetGain(p,a,b) (p)->SetGain(a,b)
#define IDirectInputEffectDriver_SendForceFeedbackCommand(p,a,b) (p)->SendForceFeedbackCommand(a,b)
#define IDirectInputEffectDriver_GetForceFeedbackState(p,a,b) (p)->GetForceFeedbackState(a,b)
#define IDirectInputEffectDriver_DownloadEffect(p,a,b,c,d,e) (p)->DownloadEffect(a,b,c,d,e)
#define IDirectInputEffectDriver_DestroyEffect(p,a,b) (p)->DestroyEffect(a,b)
#define IDirectInputEffectDriver_StartEffect(p,a,b,c,d) (p)->StartEffect(a,b,c,d)
#define IDirectInputEffectDriver_StopEffect(p,a,b) (p)->StopEffect(a,b)
#define IDirectInputEffectDriver_GetEffectStatus(p,a,b,c) (p)->GetEffectStatus(a,b,c)
#endif
#endif /* DIJ_RINGZERO */
/****************************************************************************
*
* IDirectInputJoyConfig
*
****************************************************************************/
/****************************************************************************
*
* Definitions copied from the DDK
*
****************************************************************************/
#ifndef JOY_HW_NONE
/* pre-defined joystick types */
#define JOY_HW_NONE 0
#define JOY_HW_CUSTOM 1
#define JOY_HW_2A_2B_GENERIC 2
#define JOY_HW_2A_4B_GENERIC 3
#define JOY_HW_2B_GAMEPAD 4
#define JOY_HW_2B_FLIGHTYOKE 5
#define JOY_HW_2B_FLIGHTYOKETHROTTLE 6
#define JOY_HW_3A_2B_GENERIC 7
#define JOY_HW_3A_4B_GENERIC 8
#define JOY_HW_4B_GAMEPAD 9
#define JOY_HW_4B_FLIGHTYOKE 10
#define JOY_HW_4B_FLIGHTYOKETHROTTLE 11
#define JOY_HW_TWO_2A_2B_WITH_Y 12
#define JOY_HW_LASTENTRY 13
/* calibration flags */
#define JOY_ISCAL_XY 0x00000001l /* XY are calibrated */
#define JOY_ISCAL_Z 0x00000002l /* Z is calibrated */
#define JOY_ISCAL_R 0x00000004l /* R is calibrated */
#define JOY_ISCAL_U 0x00000008l /* U is calibrated */
#define JOY_ISCAL_V 0x00000010l /* V is calibrated */
#define JOY_ISCAL_POV 0x00000020l /* POV is calibrated */
/* point of view constants */
#define JOY_POV_NUMDIRS 4
#define JOY_POVVAL_FORWARD 0
#define JOY_POVVAL_BACKWARD 1
#define JOY_POVVAL_LEFT 2
#define JOY_POVVAL_RIGHT 3
/* Specific settings for joystick hardware */
#define JOY_HWS_HASZ 0x00000001l /* has Z info? */
#define JOY_HWS_HASPOV 0x00000002l /* point of view hat present */
#define JOY_HWS_POVISBUTTONCOMBOS 0x00000004l /* pov done through combo of buttons */
#define JOY_HWS_POVISPOLL 0x00000008l /* pov done through polling */
#define JOY_HWS_ISYOKE 0x00000010l /* joystick is a flight yoke */
#define JOY_HWS_ISGAMEPAD 0x00000020l /* joystick is a game pad */
#define JOY_HWS_ISCARCTRL 0x00000040l /* joystick is a car controller */
/* X defaults to J1 X axis */
#define JOY_HWS_XISJ1Y 0x00000080l /* X is on J1 Y axis */
#define JOY_HWS_XISJ2X 0x00000100l /* X is on J2 X axis */
#define JOY_HWS_XISJ2Y 0x00000200l /* X is on J2 Y axis */
/* Y defaults to J1 Y axis */
#define JOY_HWS_YISJ1X 0x00000400l /* Y is on J1 X axis */
#define JOY_HWS_YISJ2X 0x00000800l /* Y is on J2 X axis */
#define JOY_HWS_YISJ2Y 0x00001000l /* Y is on J2 Y axis */
/* Z defaults to J2 Y axis */
#define JOY_HWS_ZISJ1X 0x00002000l /* Z is on J1 X axis */
#define JOY_HWS_ZISJ1Y 0x00004000l /* Z is on J1 Y axis */
#define JOY_HWS_ZISJ2X 0x00008000l /* Z is on J2 X axis */
/* POV defaults to J2 Y axis, if it is not button based */
#define JOY_HWS_POVISJ1X 0x00010000l /* pov done through J1 X axis */
#define JOY_HWS_POVISJ1Y 0x00020000l /* pov done through J1 Y axis */
#define JOY_HWS_POVISJ2X 0x00040000l /* pov done through J2 X axis */
/* R defaults to J2 X axis */
#define JOY_HWS_HASR 0x00080000l /* has R (4th axis) info */
#define JOY_HWS_RISJ1X 0x00100000l /* R done through J1 X axis */
#define JOY_HWS_RISJ1Y 0x00200000l /* R done through J1 Y axis */
#define JOY_HWS_RISJ2Y 0x00400000l /* R done through J2 X axis */
/* U & V for future hardware */
#define JOY_HWS_HASU 0x00800000l /* has U (5th axis) info */
#define JOY_HWS_HASV 0x01000000l /* has V (6th axis) info */
/* Usage settings */
#define JOY_US_HASRUDDER 0x00000001l /* joystick configured with rudder */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -