It depends on the context in which you are using the keyboard. For text/plain input this shouldn't be an issue. However, tab is used to change focus from one element to another. Since tab is non-existent on most SoftIME's Android intercepts TAB and feeds Enter, this helps in most cases where a form is being filled out or where the focus needs to change to another element after input.
ex) username & password
user enters their username and presses enter, the focus is now changed to the password column.
Additionally android uses something called EditorInfo to change the states of its keyboards. Look at this thread for a simple use of the EditorInfo -> Android: how to make keyboard enter button say "Search" and handle its click?
I've run into this issue a couple times. The only way to change it is overriding an onKeyListener or making a custom EditText where you override the onKeyDown function. That way calling keyCode == KeyEvent.KEYCODE_TAB will give you the actual value.
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_TAB)
{
tab(); // implemented seperate
return false; // ignore focus changes when tab is pressed
}
super.onKeyUp(keyCode, event);
}
// additional helper methods
public void insert(String s)
{
int start = start();
int end = end();
if(start != end)
{
replace(s, start, end);
}
else
{
getEditableText().insert(start, s);
}
setSelection(start); // changes focus back to edittext
}
public void replace(String s, int st, int e)
{
getEditableText().replace(st, e, s);
}
public void tab()
{
insert("\t");
}
Hope this helps you out.
-Chris