Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.4 KiB

  1. //-----------------------------------------------------------------------------
  2. // File: diutil.h
  3. //
  4. // Desc: DirectInput support
  5. //
  6. // Copyright (C) 1995-1999 Microsoft Corporation. All Rights Reserved.
  7. //-----------------------------------------------------------------------------
  8. #ifndef DIUTIL_H
  9. #define DIUTIL_H
  10. #include "dinput.h"
  11. #include "lmcons.h"
  12. #define MAX_INPUT_DEVICES 4
  13. #define NUMBER_OF_PLAYERS 1
  14. #define NUMBER_OF_ACTIONFORMATS 1
  15. //for axes commands: AXIS_LR and AXIS_UD
  16. #define AXIS_MASK 0x80000000l
  17. #define AXIS_LR (AXIS_MASK | 1)
  18. #define AXIS_UD (AXIS_MASK | 2)
  19. // "Keyboard" commands
  20. #define KEY_STOP 0x00000001l
  21. #define KEY_DOWN 0x00000002l
  22. #define KEY_LEFT 0x00000004l
  23. #define KEY_RIGHT 0x00000008l
  24. #define KEY_UP 0x00000010l
  25. #define KEY_FIRE 0x00000020l
  26. #define KEY_THROW 0x00000040l
  27. #define KEY_SHIELD 0x00000080l
  28. #define KEY_DISPLAY 0x00000100l
  29. #define KEY_QUIT 0x00000200l
  30. #define KEY_EDIT 0x00000400l
  31. // Prototypes
  32. HRESULT DIUtil_Initialize( HWND hWnd );
  33. HRESULT DIUtil_ConfigureDevices(HWND hWnd, IUnknown FAR * pddsDIConfig, DWORD dwFlags);
  34. VOID DIUtil_CleanupDirectInput();
  35. VOID UpdateShips();
  36. // Constants used for scaling the input device
  37. #define DEADZONE 2500 // 25% of the axis range
  38. #define RANGE_MAX 1000 // Maximum positive axis value
  39. #define RANGE_MIN -1000 // Minimum negative axis value
  40. #endif //DIUTIL_H