Moving Two Fingers on Screen on Mobile Triggers ESC Button
Moderators: marionline, SDHawk
Moving Two Fingers on Screen on Mobile Triggers ESC Button
Is there any way to disable this? I know the engine doesn't allow simultaneous touchscreen motions, but for some reason it triggers the ESC key to be pressed. My concern is that it can be done on accident. For example, if a player is resting part of the hand on the screen unintentionally and swipes it could exit the game.
- Bob the Hamster
- Lord of the Slimes
- Posts: 7658
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
I think you typed this on mobile... I don't think you could do multi-touch with your tongue!Bob the Hamster wrote:Double-tongued on mobile
Unfortunately I don't have a multitouch phone, so can't test this. Luckily, the Android emulator somewhat recently added the ability to simulate multitouch events, by forwarding touches from an app running on a tethered phone. Unfortunately I don't have a multitouch phone.
Last edited by TMC on Wed Mar 29, 2017 9:59 am, edited 2 times in total.
- Bob the Hamster
- Lord of the Slimes
- Posts: 7658
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
Oh, autocorrect, you always makeup​ me smiles
By lucky coincidence, yesterday I submitted "OHRRPGCE Input Test" to the app store.
I could only make this happen with two-fingers when swiping quickly and rapidly upward. However, swiping with three fingers reproduced it very consistently. It was almost always the Android "Menu" button, which is mapped to ESC by default. Sometimes I could also get it to do the "Back" button, but only randomly. Back is also mapped to ESC
I'll have to do some more research to figure out if this is an Android feature or an sdl-android feature
By lucky coincidence, yesterday I submitted "OHRRPGCE Input Test" to the app store.
I could only make this happen with two-fingers when swiping quickly and rapidly upward. However, swiping with three fingers reproduced it very consistently. It was almost always the Android "Menu" button, which is mapped to ESC by default. Sometimes I could also get it to do the "Back" button, but only randomly. Back is also mapped to ESC
I'll have to do some more research to figure out if this is an Android feature or an sdl-android feature
- Spoonweaver
- Liquid Metal King Slime
- Posts: 6461
- Joined: Mon Dec 08, 2008 7:07 am
- Contact:
It occurs to me that both tmc and bob James have mentioned a few times that the lack of access to certain devices has held up ohr development.
I frequent garage sales that sell these types of devices regularly for about a dollar. So if you have some sort of list of devices you'd need for testing, I could keep an eye out. I doubt I'll be able to find a new iphone7 but I've seen several droids and iPod touches. Also I don't think the shipping to either of you will be too bad and I would be glad to do it if it helps ohr development.
I frequent garage sales that sell these types of devices regularly for about a dollar. So if you have some sort of list of devices you'd need for testing, I could keep an eye out. I doubt I'll be able to find a new iphone7 but I've seen several droids and iPod touches. Also I don't think the shipping to either of you will be too bad and I would be glad to do it if it helps ohr development.
Messing around with the Input Test app on my Droid Turbo 2 I found that pinching with 2 fingers triggers "Back" without fail. Putting three fingers on the screen at once and moving them triggers "Main" most of the time or "Back" depending on the motions. That's less concerning to me as you have to really try to do it.
EDIT: Actually trying a few more things I discovered if you place one finger on the screen and swipe the other finger right it triggers "Main" and if you swipe left it triggers "Back."
This works 100% of the time.
EDIT: Actually trying a few more things I discovered if you place one finger on the screen and swipe the other finger right it triggers "Main" and if you swipe left it triggers "Back."
This works 100% of the time.
Last edited by Soule X on Wed Mar 29, 2017 10:08 pm, edited 1 time in total.
- Bob the Hamster
- Lord of the Slimes
- Posts: 7658
- Joined: Tue Oct 16, 2007 2:34 pm
- Location: Hamster Republic (Ontario Enclave)
- Contact:
I have a few android devices laying around that I can test with thanks to work, so I don't have a shortage of those.
I do love the idea of getting a newer-than-2010 android device into tmc's hands, and would gladly chip in for the shipping :)
Thanks for the testing Soule X! I can reproduce what you describe.
I'll bet my 3-finger mashing was just confusing whatever gesture-recognition system does this feature.
When I build the apk file, I can override the menu/back buttons to do something other than ESC by editing a config file, so if you are working on a game for android that is messed up by these, I can make an apk for you that remaps these to some other harmless keys.
I think ESC makes a good default for these buttons in most ohrrpgce games, but obviously not for a game that has mouse/touch controls.
I do love the idea of getting a newer-than-2010 android device into tmc's hands, and would gladly chip in for the shipping :)
Thanks for the testing Soule X! I can reproduce what you describe.
I'll bet my 3-finger mashing was just confusing whatever gesture-recognition system does this feature.
When I build the apk file, I can override the menu/back buttons to do something other than ESC by editing a config file, so if you are working on a game for android that is messed up by these, I can make an apk for you that remaps these to some other harmless keys.
I think ESC makes a good default for these buttons in most ohrrpgce games, but obviously not for a game that has mouse/touch controls.
Hmm, sdl_android does have a bunch of code for multitouch in Video.java. I don't really know what it does, it seems like it's just forwarding events to DemoGLSurfaceView_nativeMotionEvent, in project/jni/sdl-1.2/src/video/android/SDL_androidinput.c. Ah ha, in that file is the code for recognising multitouch gestures. Wow, not the sort of code you want to figure out. But it seems that it reads the keycodes to generate from the multitouchGestureKeycode array, equal to SDL_ANDROID_SCREENKB_KEYCODE_[6-9]. And you can see that in SDL_androidinput.h that these are #defined to SDL_ANDROID_KEYCODE_{4,5,8,9}. Looking in keymap.c, 4,5 are LCTRL and ESCAPE (and also used as KEYCODE_MENU, KEYCODE_BACK), while 8,9 are LALT and RALT. These don't seem to be directly affected by AndroidAppSettings.cfg, but maybe there's another layer of remapping that occurs. But what does the 'AppUsesMultitouch' setting in the .cfg file do?
I should probably get my hands on a gamepad, or even better, multiple gamepads since the code for that is clearly nonsense and needs to be rewritten. (I think James has a gamepad?) Not buying one is just laziness on my part. Recently I tried using my joystick emulator but it had mysteriously stopped working, and it was impossible to actually play anything with it anyway.
An iPod Touch would be ideal for porting to iOS, but even old models don't seem to be that cheap here. However I don't really want to start on an iOS port soon, I don't think it's a high priority.
I really should buy a new cellphone. But I've only had mine five years; a computer should last at least five years!
Cool! Obscure android hardware and consoles like the FireTV need testing, but realistically, most of the consoels were released fairly recently so probably won't be found for $1.I frequent garage sales that sell these types of devices regularly for about a dollar.
I should probably get my hands on a gamepad, or even better, multiple gamepads since the code for that is clearly nonsense and needs to be rewritten. (I think James has a gamepad?) Not buying one is just laziness on my part. Recently I tried using my joystick emulator but it had mysteriously stopped working, and it was impossible to actually play anything with it anyway.
An iPod Touch would be ideal for porting to iOS, but even old models don't seem to be that cheap here. However I don't really want to start on an iOS port soon, I don't think it's a high priority.
I really should buy a new cellphone. But I've only had mine five years; a computer should last at least five years!
Last edited by TMC on Wed Mar 29, 2017 10:44 pm, edited 2 times in total.