How to select softkey on Android emulator keyboard

I am using Appium 1.6.4 and cannot select the ‘Search’ key (I believe it would be the Enter key with the magnifying glass on the Android keyboard).

Some options I have tried are
.sendKeys(“result” + “\n”);

Have you tried :
driver.pressKeyCode(AndroidKeyCode.KEYCODE_SEARCH) or driver.pressKeyCode(AndroidKeyCode.KEYCODE_ENTER) ?
This is what I use to validate a text field.

I am not able to use pressKeyCode

Currently on 5.0.0-BETA9 Java client and tested in 4.1.2.

I appreciate the help! Any other suggestions?

@JD why not able to use pressKeyCode (it is in java-client 5.any)?

 ((AndroidDriver) driver).pressKeyCode(key);

I was able to use the pressKeyCode method. However, that still didn’t resolve my issue and I’m still not able to click ‘Enter’ on the search field.

I tried entering “\n” in the sendKeys event as well as a few other options.

Workaround for now:

TouchAction tc = new TouchAction(driver);
tc.tap(950,1700).perform();

Thanks for the help!