Android Not Sending Correct Keypresses (ESC, Backspace, Shift) on ODROID U2
#31
This is massive for android users. I use my keyboard all the time for renaming favourites, putting favourites on my home screen, setting up smart playlists, searching for movies, typing in passwords etc.

I really hope the backspace button can be sorted out (in the xbmc on-screen keyboard/virtual keyboard it should "delete-to-the-left" but it doesn't).

There are others.

Above all it would be great if all keys were user configurable via the keyboard.xml but it seems when using this file that some things work and others are ignored completely.

one question though, how long do these type of changes take to trickle down to the official stable release? Or more to the point for me personally, will i then have to wait for pivos to incorporate these xbmc changes into their app?
Reply
#32
Hello, has anyone been able to try this fix and see if it is working? I am not sure if I downloaded a build that has the fix or not but I tried loading it on my GBox MX2 and it does not work properly.
The Matricom developer is non-existent these days and is not responding to apply and try out the keyboard fix for their customized MX2 version. So I tried to find a most current nightly build here at XBMC and installed it. It failed to work properly. The shift keys and other keys still not working properly on the MX2. I don't know if it is because it is incompatible with the MX2 or is the fix not a total fix pointing to more code changes needed elsewhere in the keyboard decoding routine. Anyway, just wanted to give a status and to see if anyone has tried it on another Android device to see if it works.
The version of the XBMC for Android nightly build I tried is this one:
•http://www.gtlib.gatech.edu/pub/xbmc/nightlies/android/xbmc-20130731-d327047-master-armeabi-v7a.apk (us, prio 100)
Reply
#33
(2013-07-28, 06:59)davilla Wrote: in the future, a patch or a PR will get more attention Smile

davilla, I think the AndroidKey.cpp program needs further update fixing to make those new key mappings for SHIFT, ALT and CTRL keys to work properly.
I tried loading the latest nightly builds from Aug 02,2013 and Aug 03, 2013 and those keys still are not responding correctly. Assuming that the AndroidKey.cpp patch was included in those builds, then it seems like more needs to be changed or added to the code to make them recognized properly.
I think the next segment of code that needs to be added or updated is the part in the AndroidKey.cpp file where it is checking for "modifiers". Like here:
...
uint16_t modifiers = 0;
if (state & AMETA_ALT_LEFT_ON)
modifiers |= XBMCKMOD_LALT;
if (state & AMETA_ALT_RIGHT_ON)
modifiers |= XBMCKMOD_RALT;
if (state & AMETA_SHIFT_LEFT_ON)
modifiers |= XBMCKMOD_LSHIFT;
if (state & AMETA_SHIFT_RIGHT_ON)
modifiers |= XBMCKMOD_RSHIFT;
...

I think you may need to add checking now also for the SHIFT key states. Can you give it a try and see if it fixes the key recognitions?

I've only just begun to troubleshoot analyse the new keyboard symtoms I saw in the latest nightly build. But I found this.
In the Android source code file /mbx091512c/frameworks/base/core/java/android\view/KeyEvent.java I see definitions for META keys like this (and would guess that they have corresponding Android to XBMC names like "AMETA_SHIFT_LEFT_ON" and "AMETA_SHIFT_RIGHT_ON" for example):
See starting at around line number: 1856 of the KeyEvent.java I cut and pasted this from:

/**
* <p>Returns the state of the meta keys.</p>
*
* @return an integer in which each bit set to 1 represents a pressed
* meta key
*
* @see #isAltPressed()
* @see #isShiftPressed()
* @see #isSymPressed()
* @see #isCtrlPressed()
* @see #isMetaPressed()
* @see #isFunctionPressed()
* @see #isCapsLockOn()
* @see #isNumLockOn()
* @see #isScrollLockOn()
* @see #META_ALT_ON <-- I think we have to include checking these in the XBMC AndroidKey.cpp file. (i.e - add prefix "A" to become AMETA_ALT_ON Bill Yee)
* @see #META_ALT_LEFT_ON <-- I think we have to include checking these in the XBMC AndroidKey.cpp file. (i.e - add prefix "A" to become AMETA_ALT_LEFT_ON Bill Yee)
* @see #META_ALT_RIGHT_ON <-- I think we have to include checking these in the XBMC AndroidKey.cpp file. (i.e - add prefix "A" to become AMETA_ALT_RIGHT_ON Bill Yee)
* @see #META_SHIFT_ON <-- I think we have to include checking these in the XBMC AndroidKey.cpp file. ditto^
* @see #META_SHIFT_LEFT_ON <-- I think we have to include checking these in the XBMC AndroidKey.cpp file. ditto^
* @see #META_SHIFT_RIGHT_ON <-- I think we have to include checking these in the XBMC AndroidKey.cpp file. ditto^
* @see #META_SYM_ON
* @see #META_FUNCTION_ON
* @see #META_CTRL_ON <-- I think we have to include checking these in the XBMC AndroidKey.cpp file. ditto^
* @see #META_CTRL_LEFT_ON <-- I think we have to include checking these in the XBMC AndroidKey.cpp file. ditto^
* @see #META_CTRL_RIGHT_ON <-- I think we have to include checking these in the XBMC AndroidKey.cpp file. ditto^
* @see #META_META_ON
* @see #META_META_LEFT_ON
* @see #META_META_RIGHT_ON
* @see #META_CAPS_LOCK_ON <-- I think we have to include checking these in the XBMC AndroidKey.cpp file. ditto^
* @see #META_NUM_LOCK_ON
* @see #META_SCROLL_LOCK_ON
* @see #getModifiers
*/

I have not found where those XBMC Android variable names are defined at the moment but am guessing their definitions/declares must be somewhere (i.e. - AMETA_<key_press_description> ).

Update: Nevermind, I see that those AMETA_* keys (i.e. - AMETA_SHIFT_LEFT_ON) look to be setup in the Android source code directory ./frameworks/base/libs/ui/KeyCharacterMap.cpp program. Must be something else why the SHIFT keys did not seem to work for me with the nightly build I tried.
Reply
#34
Here is another area of the code in AndroidKey.cpp that I am wondering about if it can be why the SHIFT keys still not recognized fully and properly...
See this code snippet from that program:

switch (AKeyEvent_getAction(event))
{
case AKEY_EVENT_ACTION_DOWN:
CXBMCApp::android_printf("CXBMCApp: key down (code: %d; repeat: %d; flags: 0x%0X; alt: %s; shift: %s; sym: %s)",
keycode, repeatCount, flags,
(state & AMETA_ALT_ON) ? "yes" : "no",
(state & AMETA_SHIFT_ON) ? "yes" : "no",
(state & AMETA_SYM_ON) ? "yes" : "no");
XBMC_Key((uint8_t)keycode, sym, modifiers, false);
return true;

case AKEY_EVENT_ACTION_UP:
CXBMCApp::android_printf("CXBMCApp: key up (code: %d; repeat: %d; flags: 0x%0X; alt: %s; shift: %s; sym: %s)",
keycode, repeatCount, flags,
(state & AMETA_ALT_ON) ? "yes" : "no",
(state & AMETA_SHIFT_ON) ? "yes" : "no",
(state & AMETA_SYM_ON) ? "yes" : "no");
XBMC_Key((uint8_t)keycode, sym, modifiers, true);
return true;

case AKEY_EVENT_ACTION_MULTIPLE:
CXBMCApp::android_printf("CXBMCApp: key multiple (code: %d; repeat: %d; flags: 0x%0X; alt: %s; shift: %s; sym: %s)",
keycode, repeatCount, flags,
(state & AMETA_ALT_ON) ? "yes" : "no",
(state & AMETA_SHIFT_ON) ? "yes" : "no",
(state & AMETA_SYM_ON) ? "yes" : "no");
break;

default:
CXBMCApp::android_printf("CXBMCApp: unknown key (code: %d; repeat: %d; flags: 0x%0X; alt: %s; shift: %s; sym: %s)",
keycode, repeatCount, flags,
(state & AMETA_ALT_ON) ? "yes" : "no",
(state & AMETA_SHIFT_ON) ? "yes" : "no",
(state & AMETA_SYM_ON) ? "yes" : "no");
break;
}

return false;
}

In the "case AKEY_EVENT_ACTION_MULTIPLE:" test where it is detecting for Multiple keys pressed...
It looks like it is doing nothing except the print statement. Is it just supposed to fall through and return false?
Or are a couple of lines missing there? Like in the case for key "UP" event, it calls
XBMC_Key((uint8_t)keycode, sym, modifiers, true);
and then it
return true;

There is nothing done in multiple key press event. Is it supposed to be like that?
Is trying to type a CAPITAL letter by pressing the shift key and a Letter key considered a "multiple keys press" event?
Could it be hitting this leg of the logic switch statement and not doing anything? That's why pressing SHIFT key now, does Nothing at all.
Reply
#35
f you don't see 'CXBMCApp: key multiple' in xbmc.log, then pay no attention to that section of code.
Reply
#36
(2013-07-28, 15:47)thebearnecessit Wrote: I really hope the backspace button can be sorted out (in the xbmc on-screen keyboard/virtual keyboard it should "delete-to-the-left" but it doesn't).

There are others.

Above all it would be great if all keys were user configurable via the keyboard.xml but it seems when using this file that some things work and others are ignored completely.

How long do these type of changes take to trickle down to the official stable release? Or more to the point for me personally, will i then have to wait for pivos to incorporate these xbmc changes into their app?[/b]

anyone know if these buttons work on android yet? or if the keyboard.xml file works yet?
Reply
#37
Bump on this one......Has there ever been a fix to this? I have a Matricom G-Box MX2 (Android 4.2.2/XBCM Frodo 12.something) with a Logitech K400 keyboard and in XBMC, the backspace, shift, and escape buttons do not work correctly. Not being able to use the backspace button to go "back" really sucks. Also, for inputting symbols such as ! @ # $ % ^, etc., I have to use the trackpad to navigate the onscreen keyboard due to the shift keys not working correctly. I keep searching and searching and do not know what the solution is to this issue. Is there something I'm missing hereHuh
Reply
#38
I don't think this issue is specific to xbmc. When I installed ES Explorer and tried to enter my credentials for my google drive it also occurred there. It wouldn't recognize the shift key. But in other applications it works fine.
Reply
#39
Having the same issues as everyone stated here. Is this just something the developers can't/won't fix?
Reply
#40
(2014-02-04, 00:27)osok Wrote: Having the same issues as everyone stated here. Is this just something the developers can't/won't fix?

If there was an issue just in XBMC then it has most likely been fixed by now in a nightly build (wiki). However, I have seen similar issues when it effects all of Android, and that will likely require a firmware update for that specific device.
Reply
#41
(2014-01-17, 16:43)Ronald McDonald Wrote: Also, for inputting symbols such as ! @ # $ % ^, etc.,
That was solved recently in nightlies, indeed.
The rest of the hw keyboard issues were also solved in Gotham long ago.

Bottom-line: Use Gotham nightlies (wiki). There won't be anymore bugfix releases for Frodo.
Reply
#42
Ned and Koying are correct. If you have v12 Frodo on Android, it is likely you'll have issues with a few keys (backspace button, shift keys, and others). It is REALLY annoying and at times makes me want to throw my wireless keyboard at my TV. I downloaded a recent version of v13 Gotham to my device (G-box MX2) and it fixed the problems with my keyboard, but then I had issues with my add-ons so I just went back to v12 for now and am just dealing with the keyboard crap. If you have a Logitech K400 like me, you can use the right mouse click button for the "back" feature instead of backpace. It works. I'm sure I'll try v13 Gotham nightlys or monthlys again when I'm feeling adventurous but for now v12 "works".
Reply
#43
I'll have to test out the keyboard shift in the actual android interface (I'm running a gbox mx2 btw). I don't recall noticing it not working but to be honest may not have ever had to use the shift in the other apps.

Will report back later..thanks
Reply

Logout Mark Read Team Forum Stats Members Help
Not Sending Correct Keypresses (ESC, Backspace, Shift) on ODROID U21