Author Topic: Beta Testing Has Begun!  (Read 807294 times)

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Beta Testing Has Begun!
« Reply #45 on: December 29, 2011, 02:58:36 PM »
Mapping it with the sixaxis app as an IME is broken.

That must be a problem with the sixaxis program, not yours.

@ poke
thank you, for adding the option for other mac adresses in your app. It's worth a million.  :)

I can not map keys with the USB Joystick Center, too. I really think its not a Sixaxis/USB Joystick Center problem. Tested with the last Beta 1.2 Version.

What behavior do you see?  Does the Key Listener dialog at least disappear, or does it not react to the input at all?  I'm not sure what I can change if it is not reacting at all.  The onKey method before adding support for the higher key-codes is very basic.. it just converts the first 110 android keycodes into standard SDL scancodes, or returns SDL_SCANCODE_UNKNOWN - in either case the dialog box should dismiss if it detected any key input:
Code: [Select]
    @Override
    public boolean onKey( DialogInterface dialog, int keyCode, KeyEvent event )
    {
        if( keyCode == KeyEvent.KEYCODE_MENU )
        {
            parent.returnCode( SDL_SCANCODE_UNKNOWN );  // to unmap a button
            dismiss();
        }
        else
        {
            int k = keyCode;
            if( k < 0 || k > 110 )
                k = SDL_SCANCODE_UNKNOWN;
            if( parent != null )
                parent.returnCode( Android_Keycodes[k] );
            dismiss();
        }
        return true;
    }
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline firstpoke

  • byte
  • *
  • Posts: 27
    • View Profile
Re: Beta Testing Has Begun!
« Reply #46 on: December 30, 2011, 11:30:27 AM »

What behavior do you see?  Does the Key Listener dialog at least disappear, or does it not react to the input at all?  I'm not sure what I can change if it is not reacting at all. 

Its easy... you have to implement a Text-Input field in the popup and textfield.requestFocus() ... then it should be working. Also an inputfiled.setOnKeyListener( new OnKeyListerner() { ...

Hint: Also you have to insert my Analog-Key function ("getKeyData"):

Code: [Select]
@Override
    public boolean onKey( DialogInterface dialog, int keyCode, KeyEvent event )
    {
       
        int[] code = getKeyData(keyCode, event);
        keyCode = code[0];

        if( keyCode == KeyEvent.KEYCODE_MENU )
        {
            parent.returnCode( SDL_SCANCODE_UNKNOWN );  // to unmap a button
            dismiss();
        }
        else
        {
            int k = keyCode;
            if( k < 0 || k > 110 )
                k = SDL_SCANCODE_UNKNOWN;
            if( parent != null )
                parent.returnCode( Android_Keycodes[k] );
            dismiss();
        }
        return true;
    }

Because without it, you will only get keycodes > 255
« Last Edit: December 30, 2011, 11:39:07 AM by firstpoke »

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Beta Testing Has Begun!
« Reply #47 on: December 30, 2011, 07:02:18 PM »
Its easy... you have to implement a Text-Input field in the popup and textfield.requestFocus() ... then it should be working.
I assume you mean an EditText (or would it work with a non-editable TextView --EDIT-- just tested with a non-editable TextView, and that didn't work, so I guess it must be an EditText)  I don't want an EditText on the dialog window.  Not only would that look silly, it would pop up the user's virtual keyboard any time they weren't using an IME for the keyboard.

I still don't understand why it shouldn't detect the keys as it is.. it works on my phone (i can hook up my wiimote with nunchuck, wiimote classic, or zeemote without any problems).  The problem with the sixaxis IME is likely because:
This problem seems to occur, if you have enabled a touch profile on the sixaxis app.
I'd assume a "touch profile" generates touch events, which would explain why a key listener doesn't detect that input.  Your IME produces key events, so that input should be detectable.

Hint: Also you have to insert my Analog-Key function ("getKeyData"):
Yeh, you gave me that code earlier.  I'm more interested in knowing if the key events are even being detected by the dialog window in the first place, before I start adding more stuff to it.  Does the dialog react to the key presses or not? (it should at least dismiss the window)  If not, I'll ask around on various forums for a way to detect the key presses without putting an EditText on the dialog.  Surely it is possible (besides, that wouldn't be a viable option in-game anyway).
« Last Edit: December 30, 2011, 08:21:46 PM by Paul »
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline firstpoke

  • byte
  • *
  • Posts: 27
    • View Profile
Re: Beta Testing Has Begun!
« Reply #48 on: December 30, 2011, 09:11:51 PM »
I don't want an EditText on the dialog window.  Not only would that look silly, it would pop up the user's virtual keyboard any time they weren't using an IME for the keyboard.

Thats not a problem... you have to insert this:
android:focusable="true" android:focusableInTouchMode="true"

... in the Layout tag were you have placed the EditText Element. Then the virtual keyboard will not popup.

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Beta Testing Has Begun!
« Reply #49 on: December 30, 2011, 09:25:59 PM »
Well I still want to do this without a EditText if its possible.  I still don't have a full understanding of the problem yet.. does the dialog dismiss when you press the buttons or not?
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline firstpoke

  • byte
  • *
  • Posts: 27
    • View Profile
Re: Beta Testing Has Begun!
« Reply #50 on: December 30, 2011, 09:48:51 PM »
I still don't have a full understanding of the problem yet.. does the dialog dismiss when you press the buttons or not?

The dialog is still there. It seems that nothing happens.

Offline firstpoke

  • byte
  • *
  • Posts: 27
    • View Profile
Re: Beta Testing Has Begun!
« Reply #51 on: December 30, 2011, 10:52:06 PM »
It seems that is no focus on the PopUp Window... because I can scroll the Background MappingKey-List up/down with my Wii Remote DPAD Buttons, while the Popup Window is open.

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Beta Testing Has Begun!
« Reply #52 on: December 30, 2011, 11:54:23 PM »
It seems that is no focus on the PopUp Window... because I can scroll the Background MappingKey-List up/down with my Wii Remote DPAD Buttons, while the Popup Window is open.

Very strange.. I wonder why it gets focus for my phone.  Maybe I should explicitly request focus for an element on the dialog window, to see if that helps.  Let me know if this test has the same problem:

Focus Test

(it will install a new app labeled "Mupen64Plus Test", which you can remove without affecting the other one)

If that doesn't work, do you know if there is a way to make an EditText invisible but still focusable?  The dialog will just look ugly if it has to have a text field on it (not to mention confusing to someone who doesn't know what its even there for).
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline firstpoke

  • byte
  • *
  • Posts: 27
    • View Profile
Re: Beta Testing Has Begun!
« Reply #53 on: December 31, 2011, 12:39:04 AM »
Paul, thanks... Focus Test apk is working :)  Know I can map the keys!

What was changed?
« Last Edit: December 31, 2011, 12:40:54 AM by firstpoke »

Offline scorpio16v

  • long
  • ***
  • Posts: 203
    • View Profile
Re: Beta Testing Has Begun!
« Reply #54 on: December 31, 2011, 02:19:42 AM »
Paul, we've talked some times ago about possible native analog input for the sixaxis controller over usb.
As I said, the sixaxis will be recognized on usb and this attached config is loaded as keylayout and mapped the buttons.

Is it possible to read out analog input from there ?
As you can remember, the controller profile from InputAutoCfg.ini is not recognized by the emulator.

If we can get something usefull, I can post the config for Xbox and some other controller if you need.
Besides N64oid, many other games can read analog natively from sixaxis.
« Last Edit: December 31, 2011, 02:55:51 AM by scorpio16v »

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Beta Testing Has Begun!
« Reply #55 on: December 31, 2011, 05:16:23 AM »
As I recall, SDL didn't recognize it as a joystick (seems the Android port of SDL is not complete).  I can definitely add support for it another way though.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Beta Testing Has Begun!
« Reply #56 on: December 31, 2011, 05:25:26 AM »
Paul, thanks... Focus Test apk is working :)  Know I can map the keys!

What was changed?
I just added a line of code to tell the TextView that says "press a key" to grab focus (which gives the dialog window focus since the TextView is not editable).  I'm not sure why the dialog didn't automatically get focus when it's popped up.. it does on my phone, which is why I assumed it would work for everyone (gotta love developing for multiple devices and OS versions..)

Anyway, I'm adding in the stuff for the high key codes next.  I'll post another test for you to run later, once I get it connected up with the input plug-in for analog control.
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline firstpoke

  • byte
  • *
  • Posts: 27
    • View Profile
Re: Beta Testing Has Begun!
« Reply #57 on: December 31, 2011, 08:02:00 AM »
I'll post another test for you to run later, once I get it connected up with the input plug-in for analog control.

 ;D, nice... Super Mario 64 with Analog Control .. I will love it, can't wait  :)

Offline Paul

  • Administrator
  • double
  • *****
  • Posts: 3495
  • Developer
    • View Profile
    • PaulsCode.Com
Re: Beta Testing Has Begun!
« Reply #58 on: December 31, 2011, 04:59:25 PM »
Ok, I've implemented the high codes for analog control, but I am unable to test it myself.

If it doesn't work at all (or is glitchy/ unresponsive), please provide the logcat after mapping the analog control to the two axes in Settings->Input->Configure then running the game and moving the analog control around a bit.

If it does work but either axis needs to be reversed (i.e., if up goes down or left goes right), then I won't need the logcat in that case.. just let me know which directions need to be reversed.

USB IME Test
Device: Samsung Galaxy Nexus i515
CPU: TI OMAP4460, 1.2 GHz (dual core, ARM Cortex-A9)
GPU: PowerVR SGX540, 307 MHz
RAM: 1 GB
Resolution: 720 x 1280
Rom: omni-4.4.4-20141014-toro-FML KitKat 4.4.4, rooted

Device: Eee PC 1015PEM
CPU: Intel Atom N550, 1.5 GHz (dual core, x86)
GPU: Intel GMA 3150, 200 MHz (dual core)
RAM: 2GB
Resolution: 1024 x 600
Rom: android-x86-4.3-20130725 Jelly Bean 4.3, rooted

Offline firstpoke

  • byte
  • *
  • Posts: 27
    • View Profile
Re: Beta Testing Has Begun!
« Reply #59 on: January 01, 2012, 08:00:26 AM »
If it does work but either axis needs to be reversed (i.e., if up goes down or left goes right), then I won't need the logcat in that case.. just let me know which directions need to be reversed.

Analog control is amazing :-) Pure fun!

Ok, its working fine. Only up/down are reversed and it didnt recognize the key up event (Mario walks slow and dont stop his move). Ah, and from time to time while Im setting the analog key in the mapping section, the key scancode is 81 and not 21 (but this was only 2 times of 8 trys).