Page 1 of 1

Hide soft keyboard in ranorex C# Code

Posted: Thu Nov 05, 2015 11:28 pm
by svelaga
Hi
One of the text field opens the soft keyboard and as i do not enter any data into it ... the keyboard is still shown and this makes the other options on the application to be hidden at the back of the keyboard and untill I manually close the soft keyboard I could not see or perform any action on them

Can you tell me how to hide the softkeyboard on the android device (using Ranorex c# code level)

I tried with key press and all the stuff shown in google but none could help me to close the keyboard ...


Regards
Sunitha

Re: Hide soft keyboard in ranorex C# Code

Posted: Fri Nov 06, 2015 8:42 am
by odklizec
Hi,

I'm not testing on Android so I'm not quite sure about the following suggestion ;) There was introduced possibility (in 5.3.0) of using Go (IME_ACTION_GO) and Done (IME_ACTION_DONE) IME events via Mobile Key Press action. I think the Done event is what you are looking for? Android API says this about IME_ACTION_DONE:
Bits of IME_MASK_ACTION: the action key performs a "done" operation, typically meaning there is nothing more to input and the IME will be closed.

Re: Hide soft keyboard in ranorex C# Code

Posted: Fri Nov 06, 2015 2:12 pm
by svelaga
Sorry I could not find anything to help to know on IME_ACTION_DONE ...
If anyone have idea how to close the soft keyboard in android device while Ranorex automation code using c# code. Please share your knowledge ... Thank you

Re: Hide soft keyboard in ranorex C# Code

Posted: Fri Nov 06, 2015 2:32 pm
by odklizec
As mentioned in my post, you should try to add Mobile Key Press action with parameter {DONE}. A list of available Ranorex actions can be found here:
http://www.ranorex.com/support/user-gui ... tions.html

Another possibility could be setting focus to another non-edit element (or touch it)? I'm not familiar with Android, but if I touch outside the iOS edit, which previously invoked keyboard, keyboard disappears. I guess the same should work for Android too?

Re: Hide soft keyboard in ranorex C# Code

Posted: Fri Nov 06, 2015 4:27 pm
by svelaga
Thank you ...
It is working as expected

Re: Hide soft keyboard in ranorex C# Code

Posted: Fri Nov 06, 2015 5:01 pm
by odklizec
Hi,

Good to hear that. Could you please tell us, which of both suggestions worked for you?

Re: Hide soft keyboard in ranorex C# Code

Posted: Thu Nov 12, 2015 2:55 pm
by svelaga
Add Mobile Key Press action with parameter {DONE}.
Has successfully worked for me

Re: Hide soft keyboard in ranorex C# Code

Posted: Fri Nov 13, 2015 8:54 am
by odklizec
Nice. Thanks for confirmation!