summaryrefslogtreecommitdiffstats
path: root/libs/ui/KeyLayoutMap.h
blob: 43f84ce4964d353bf67239186b0658d21a2948fe (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
#ifndef KEYLAYOUTMAP_H
#define KEYLAYOUTMAP_H

#include <utils/KeyedVector.h>

namespace android {

class KeyLayoutMap
{
public:
    KeyLayoutMap();
    ~KeyLayoutMap();

    status_t load(const char* filename);

    status_t map(int32_t scancode, int32_t *keycode, uint32_t *flags) const;
    status_t findScancodes(int32_t keycode, Vector<int32_t>* outScancodes) const;

private:
    struct Key {
        int32_t keycode;
        uint32_t flags;
    };

    status_t m_status;
    KeyedVector<int32_t,Key> m_keys;
};

};

#endif // KEYLAYOUTMAP_H