summaryrefslogtreecommitdiffstats
path: root/libs/ui/KeyLayoutMap.h
diff options
context:
space:
mode:
authorThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:31:44 -0800
committerThe Android Open Source Project <initial-contribution@android.com>2009-03-03 19:31:44 -0800
commitedbf3b6af777b721cd2a1ef461947e51e88241e1 (patch)
treef09427b843b192cccf8c3b5328cb81dddf6489fa /libs/ui/KeyLayoutMap.h
parentd5193d9394c5e58176d7bcdf50ef017f8a3b9e1e (diff)
downloadframeworks_native-edbf3b6af777b721cd2a1ef461947e51e88241e1.zip
frameworks_native-edbf3b6af777b721cd2a1ef461947e51e88241e1.tar.gz
frameworks_native-edbf3b6af777b721cd2a1ef461947e51e88241e1.tar.bz2
auto import from //depot/cupcake/@135843
Diffstat (limited to 'libs/ui/KeyLayoutMap.h')
-rw-r--r--libs/ui/KeyLayoutMap.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/libs/ui/KeyLayoutMap.h b/libs/ui/KeyLayoutMap.h
new file mode 100644
index 0000000..43f84ce
--- /dev/null
+++ b/libs/ui/KeyLayoutMap.h
@@ -0,0 +1,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