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