diff options
author | cutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475> | 2020-01-03 19:05:16 +0000 |
---|---|---|
committer | cutealien <cutealien@dfc29bdd-3216-0410-991c-e03cc46cb475> | 2020-01-03 19:05:16 +0000 |
commit | 2ae2a551a6290f46734307bbfdafea4b1a2cf2ba (patch) | |
tree | ba2f0b468640e44899fed3df2d4cc58795f4a003 /source/Irrlicht/Android/CKeyEventWrapper.h | |
download | irrlicht-2ae2a551a6290f46734307bbfdafea4b1a2cf2ba.tar.xz |
Merging r5975 through r6036 from trunk to ogl-es branch.
GLES drivers adapted, but only did make compile-tests.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@6038 dfc29bdd-3216-0410-991c-e03cc46cb475
Diffstat (limited to 'source/Irrlicht/Android/CKeyEventWrapper.h')
-rw-r--r-- | source/Irrlicht/Android/CKeyEventWrapper.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/source/Irrlicht/Android/CKeyEventWrapper.h b/source/Irrlicht/Android/CKeyEventWrapper.h new file mode 100644 index 0000000..bac23ad --- /dev/null +++ b/source/Irrlicht/Android/CKeyEventWrapper.h @@ -0,0 +1,43 @@ +// This file is part of the "Irrlicht Engine".
+// For conditions of distribution and use, see copyright notice in irrlicht.h
+
+#ifndef __C_IRR_KEY_EVENT_WRAPPER_H_INCLUDED__
+#define __C_IRR_KEY_EVENT_WRAPPER_H_INCLUDED__
+
+#include "IrrCompileConfig.h"
+
+#ifdef _IRR_COMPILE_WITH_ANDROID_DEVICE_
+
+#include <jni.h>
+
+struct android_app;
+
+namespace irr
+{
+namespace jni
+{
+
+//! Minimal JNI wrapper class around android.view.KeyEvent
+//! NOTE: Only functions we actually use in the engine are wrapped
+//! This is currently not written to support multithreading - meaning threads are not attached/detached to the Java VM (to be discussed)
+class CKeyEventWrapper
+{
+public:
+ CKeyEventWrapper(JNIEnv* jniEnv, int action, int code);
+ ~CKeyEventWrapper();
+
+ int getUnicodeChar(int metaState);
+
+private:
+ static jclass Class_KeyEvent;
+ static jmethodID Method_getUnicodeChar;
+ static jmethodID Method_constructor;
+ JNIEnv* JniEnv;
+ jobject JniKeyEvent; // this object in java
+};
+
+} // namespace jni
+} // namespace irr
+
+#endif // _IRR_COMPILE_WITH_ANDROID_DEVICE_
+#endif // __C_IRR_KEY_EVENT_WRAPPER_H_INCLUDED__
|