Wrecked Games
September 08, 2010, 03:09:18 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: We're just that awesome.
 
   Home   Help Search Members Login Register  
Pages: [1]
  Print  
Author Topic: Android input support  (Read 352 times)
calsmurf2904
Newbie
*
Posts: 2


View Profile
« on: February 22, 2010, 07:26:05 AM »

Hello, I'm a member of the Ogre forum and am currently in the process of porting Ogre to android, the problem is that the samples provided with ogre use OIS for input, but OIS doesn't have input support.

What I'm proposing is these functions:

Code:
#include <jni.h>

void Java_com_OIS_InitOIS(JNIEnv*  env);
void Java_com_OIS_HandleTouchEvent(JNIEnv* env, jint x, jint y);
void Java_com_OIS_HandleKeyEvent(JNIEnv* env, jint keycode);

So that the application can call these from java to handle any key input in OIS.
How Android handles input can be found here:
http://developer.android.com/reference/android/view/View.OnKeyListener.html#onKey(android.view.View, int, android.view.KeyEvent)
And here:
http://developer.android.com/reference/android/view/View.OnTouchListener.html

Note: Even though android supports native functions, its input system is java-only, thats why I'm proposing the OIS native functions to handle the java events.

Thanks in advance,

Calsmurf2904
Logged
pjcast
Administrator
Veteran
*****
Posts: 2546



View Profile WWW
« Reply #1 on: February 22, 2010, 08:41:15 PM »

I'd be interested in an Android port. Sad how the input system is Java only. I don't understand, however, the point of the method stubs you posted.

Are those functions to be called from within Java to OIS, or from native through OIS to Java?
Logged
calsmurf2904
Newbie
*
Posts: 2


View Profile
« Reply #2 on: February 23, 2010, 02:25:16 AM »

Those are functions that Java should call to OIS. (C++ exported functions to java have a really weird function name)
That way, OIS will just become a passthrough, but there currently is no other way to support it. (It is indeed sad that only java gets input Sad)
I hoped this can be done since I would like the Ogre Samples to run on android too (and they use OIS).
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!