]> git.lizzy.rs Git - irrlicht.git/blob - source/Irrlicht/Android/CKeyEventWrapper.h
bac23ad6e2a912bcea261223980b7638f3eb5888
[irrlicht.git] / source / Irrlicht / Android / CKeyEventWrapper.h
1 // This file is part of the "Irrlicht Engine".\r
2 // For conditions of distribution and use, see copyright notice in irrlicht.h\r
3 \r
4 #ifndef __C_IRR_KEY_EVENT_WRAPPER_H_INCLUDED__\r
5 #define __C_IRR_KEY_EVENT_WRAPPER_H_INCLUDED__\r
6 \r
7 #include "IrrCompileConfig.h"\r
8 \r
9 #ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_\r
10 \r
11 #include <jni.h>\r
12 \r
13 struct android_app;\r
14 \r
15 namespace irr\r
16 {\r
17 namespace jni\r
18 {\r
19 \r
20 //! Minimal JNI wrapper class around android.view.KeyEvent\r
21 //! NOTE: Only functions we actually use in the engine are wrapped\r
22 //! This is currently not written to support multithreading - meaning threads are not attached/detached to the Java VM (to be discussed)\r
23 class CKeyEventWrapper\r
24 {\r
25 public:\r
26         CKeyEventWrapper(JNIEnv* jniEnv, int action, int code);\r
27         ~CKeyEventWrapper();\r
28 \r
29         int getUnicodeChar(int metaState);\r
30 \r
31 private:\r
32         static jclass Class_KeyEvent; \r
33         static jmethodID Method_getUnicodeChar;\r
34         static jmethodID Method_constructor;\r
35         JNIEnv* JniEnv;\r
36         jobject JniKeyEvent;    // this object in java\r
37 };\r
38 \r
39 } // namespace jni\r
40 } // namespace irr\r
41 \r
42 #endif // _IRR_COMPILE_WITH_ANDROID_DEVICE_\r
43 #endif // __C_IRR_KEY_EVENT_WRAPPER_H_INCLUDED__\r