-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput.h
68 lines (56 loc) · 3.35 KB
/
input.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//=============================================================================
//
// ���͏��� [input.h]
// Author : natsuk4ze
//
//=============================================================================
#ifndef _INPUT_H_
#define _INPUT_H_
//*****************************************************************************
// �}�N����`
//*****************************************************************************
// �v���O������������Ƃ��Ɏg��
#define USE_KEYBOARD // �錾����ƃL�[�{�[�h�ő���\�ɂȂ�
#define USE_MOUSE // �錾����ƃ}�E�X�ő���\�ɂȂ�
#define USE_PAD // �錾����ƃp�b�h�ő���\�ɂȂ�
/* game pad��� */
#define BUTTON_UP 0x00000001l // �����L�[��(.IY<0)
#define BUTTON_DOWN 0x00000002l // �����L�[��(.IY>0)
#define BUTTON_LEFT 0x00000004l // �����L�[��(.IX<0)
#define BUTTON_RIGHT 0x00000008l // �����L�[�E(.IX>0)
#define BUTTON_A 0x00000010l // �`�{�^��(.rgbButtons[0]&0x80)
#define BUTTON_B 0x00000020l // �a�{�^��(.rgbButtons[1]&0x80)
#define BUTTON_C 0x00000040l // �b�{�^��(.rgbButtons[2]&0x80)
#define BUTTON_X 0x00000080l // �w�{�^��(.rgbButtons[3]&0x80)
#define BUTTON_Y 0x00000100l // �x�{�^��(.rgbButtons[4]&0x80)
#define BUTTON_Z 0x00000200l // �y�{�^��(.rgbButtons[5]&0x80)
#define BUTTON_L 0x00000400l // �k�{�^��(.rgbButtons[6]&0x80)
#define BUTTON_R 0x00000800l // �q�{�^��(.rgbButtons[7]&0x80)
#define BUTTON_START 0x00001000l // �r�s�`�q�s�{�^��(.rgbButtons[8]&0x80)
#define BUTTON_M 0x00002000l // �l�{�^��(.rgbButtons[9]&0x80)
#define GAMEPADMAX 4 // �����ɐڑ�����W���C�p�b�h�̍ő吔���Z�b�g
//*****************************************************************************
// �v���g�^�C�v�錾
//*****************************************************************************
HRESULT InitInput(HINSTANCE hInst, HWND hWnd);
void UninitInput(void);
void UpdateInput(void);
//---------------------------- keyboard
bool GetKeyboardPress(int nKey);
bool GetKeyboardTrigger(int nKey);
bool GetKeyboardRepeat(int nKey);
bool GetKeyboardRelease(int nKey);
//---------------------------- mouse
BOOL IsMouseLeftPressed(void); // ���N���b�N�������
BOOL IsMouseLeftTriggered(void); // ���N���b�N�����u��
BOOL IsMouseRightPressed(void); // �E�N���b�N�������
BOOL IsMouseRightTriggered(void); // �E�N���b�N�����u��
BOOL IsMouseCenterPressed(void); // ���N���b�N�������
BOOL IsMouseCenterTriggered(void); // ���N���b�N�����u��
long GetMouseX(void); // �}�E�X��X�����ɓ��������Βl
long GetMouseY(void); // �}�E�X��Y�����ɓ��������Βl
long GetMouseZ(void); // �}�E�X�z�C�[�������������Βl
//---------------------------- game pad
BOOL IsButtonPressed(int padNo,DWORD button);
BOOL IsButtonTriggered(int padNo,DWORD button);
#endif