forked from filiphsandstrom/DownloadMii-3DS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput.cpp
71 lines (63 loc) · 1.03 KB
/
input.cpp
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
69
70
71
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <malloc.h>
#include <iostream>
#include <sstream>
#include <3ds.h>
#include "utils.h"
#include "application.h"
#include "input.h"
#include "gui.h"
void UpdateInput(Input_s* input){
resetInput(input);
hidScanInput();
u32 kDown = hidKeysDown();
switch(kDown){
case KEY_A:
input->A = true;
break;
case KEY_B:
input->B = true;
break;
case KEY_X:
input->X = true;
break;
case KEY_Y:
input->Y = true;
break;
case KEY_UP:
input->Up = true;
print("Up\n");
break;
case KEY_DOWN:
input->Down = true;
print("Down\n");
break;
case KEY_LEFT:
input->Left = true;
print("Left\n");
break;
case KEY_RIGHT:
input->Right = true;
print("Right\n");
break;
case KEY_START:
input->Start = true;
break;
case KEY_SELECT:
input->Select = true;
break;
case KEY_L:
input->L = true;
break;
case KEY_R:
input->R = true;
break;
default:
break;
}
}
void resetInput(Input_s* input){
input = {};
}