I'm designing an android keyboard and am having difficulty with initiating an action command from the keyboard.
When I am using the Internet on my device and press enter after typing in a website, rather than going to a new page, a space is shown and no action is done. I'm not sure how to make my enter key become an action key when pressed.
Here's the code where I believe it should be altered:
@Override
public void onKey(int primaryCode, int[] keyCodes) {
InputConnection ic = getCurrentInputConnection();
switch (primaryCode) {
case Keyboard.KEYCODE_SHIFT:
handleShift();
break;
case 10:
//Initiate enter event or new line depending on program being used
break;
}
}
Any help would be appreciated.