Android: Keyboard/Keypad not working correctly.

Previous topic - Next topic

spacefractal

I guess this should been moved here, so its might been a repost.

Keyboard seen not working correctly on some models, and even they might quit while its should not do that.

Example on Xperia PLAY its quit on the O button, which can been pretty annoyring (that even with ALLOWESCAPE is set to false)....

migthbeen its a keyset issue really?

Here I dont mind if analog controllers dont support, its should just not quit on that button.

does GLBASIC also support full KEYBOARD, or only KEYPAD?
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

#1
seen the circle button use keynumber 305 in Quake port (not sure its was that game) for it (my friend said something like that). Its can been that issue?


In the other word: Android can use more than 8bit values for its keys.

glbasic have limit of 256 (one byte) for checking keycodes.

Its really akward, but its might been that, why some buttons not return any value.

EDIT 2:
http://developer.android.com/reference/android/view/KeyEvent.html#getKeyCode%28%29

its can return a int value, not a char, so the returned value can been more than 255, and hence this why some buttons might not work.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrTAToad

Hopefully the SDL Android version also can handle more than 8 bits for keys - if so, it should be easy to change...

spacefractal

I hope too, I do more worry about the "unused" quit key....
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

Its looke I all wrong, that phone is one of the special....

I just found this document:
http://blogs.sonyericsson.com/wp/2011/02/13/xperia-play-game-keys/

But some reason its only returned few scancodes, so something is wrong here and also all returned is different. I guess its might been somewhere manifest issue, SDL or whatever? I seen need to check even more about it.

PS. GlBasic should check the ALT key so its don't close the appliation (even with ALLOWESCAPE is set to FALSE). For DEV its should just return two values (the ALT key and CIRCLE/BACK key).
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

Kitty Hello

You can change that yourself in the file:
"...\GLBasic\Compiler\platform\android\templateproj\src\com\glbasic\test\SDLActivity.java"
Line 618:
Code (glbasic) Select

if(keyCode==KeyEvent.KEYCODE_BACK && !event.isAltPressed()) // some handle alt+back as "circle"


Clean+Rebuild then.

spacefractal

look like I can add the java code to that function, so its can use all buttons (hopefully) for the phone, including all special keys (hopefully).

Trying to do that tomorrow and, if I can get it to work you get it the changes from me.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

spacefractal

#7
its prevent it to close on CIRLCE..... but I did never rest of the buttons to work, so its one of the Android oddie.....

even moving to onKeyDown() and onKeyUp(), its does the same?

odd, even I did the same as the document shown.....

EDIT: (not tested yet with the friend, but here the circle button should work as own id) {its still not working 100%, so still trying to just doing the second button to work correctly).

Code (glbasic) Select

    // Key events
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
System.out.println("onKeyDown() : " + keyCode);
SDLActivity.onNativeKeyDown(keyCode);
return false; //super.onKeyDown(keyCode, event);
}

public boolean onKeyUp(int keyCode, KeyEvent event) {
// TODO Auto-generated method stub
System.out.println("onKeyDown() : " + keyCode);
SDLActivity.onNativeKeyUp(keyCode);
return false; //super.onKeyDown(keyCode, event);
}

    public boolean onKey(View  v, int keyCode, KeyEvent event) {
if(keyCode==KeyEvent.KEYCODE_BACK && !event.isAltPressed()) {
// mActivity.glbasicOnPause(1);
mActivity.finish();
System.exit(0);
return super.onKeyDown(keyCode, event);
}

if(keyCode==KeyEvent.KEYCODE_BACK) {
if(event.getAction() == KeyEvent.ACTION_DOWN) {
SDLActivity.onNativeKeyDown(189);
}
else {
SDLActivity.onNativeKeyUp(189);
}
}

       
        return false;
    }
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/