aboutsummaryrefslogtreecommitdiffstats
path: root/plugin/inputtypes.h
blob: bf7e82e691ae403ba0d78f7c43cc68b476ba1b9f (plain)
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
#ifndef INPUTTYPES_H
#define INPUTTYPES_H

struct CursorNavigationCommand
{
    enum Action
    {
        NoAction,
        Forward,    //tab
        Back,       //ctrl-tab
        Activate,   //enter/click on item
        Escape      //leave scope
    };

    CursorNavigationCommand();

    CursorNavigationCommand(float magnitude, int angle);

    //test if this commands angle is between given angles. clockwise from begin to end
    bool angleIsBetween(int begin, int end) const;

    float magnitude;    //0.0 to 1.0
    int angle;          //0 to 359
    Action action;

    static const CursorNavigationCommand Up;
    static const CursorNavigationCommand Down;
    static const CursorNavigationCommand Left;
    static const CursorNavigationCommand Right;

};

#endif // INPUTTYPES_H