summaryrefslogtreecommitdiff
path: root/arm9/source/devices/input.h
blob: 4f91ed50a3e91b97266aec78c2f0cedbd61abb3d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <nds.h>
#include "../types/circbuf.h"

#ifndef INPUT_H_
    #define INPUT_H_

    typedef struct {
        bool pointer;      // pointer active
        bool keyboard;     // keyboard active
        CircBuf keybuffer; // queued keypresses
        u16 x,y;           // pointer position
        u8 navigation;     // navigation state
        u8 gamepad;        // gamepad state
        bool wake;         // wake flag
    } InputDevice;

    void inp_receive_byte(InputDevice *inp, u8 byte);
    void inp_read_gamepad(InputDevice *inp);
    void inp_read_navigation(InputDevice *inp);
    void inp_read_touch(InputDevice *inp);
#endif