Hide soft keyboard in ranorex C# Code

Ranorex Spy, Recorder, and Studio.
svelaga
Posts: 9
Joined: Fri Oct 30, 2015 7:43 pm

Hide soft keyboard in ranorex C# Code

Post by svelaga » Thu Nov 05, 2015 11:28 pm

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3945
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Hide soft keyboard in ranorex C# Code

Post by odklizec » Fri Nov 06, 2015 8:42 am

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.
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

svelaga
Posts: 9
Joined: Fri Oct 30, 2015 7:43 pm

Re: Hide soft keyboard in ranorex C# Code

Post by svelaga » Fri Nov 06, 2015 2:12 pm

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

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3945
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Hide soft keyboard in ranorex C# Code

Post by odklizec » Fri Nov 06, 2015 2:32 pm

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?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

svelaga
Posts: 9
Joined: Fri Oct 30, 2015 7:43 pm

Re: Hide soft keyboard in ranorex C# Code

Post by svelaga » Fri Nov 06, 2015 4:27 pm

Thank you ...
It is working as expected

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3945
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Hide soft keyboard in ranorex C# Code

Post by odklizec » Fri Nov 06, 2015 5:01 pm

Hi,

Good to hear that. Could you please tell us, which of both suggestions worked for you?
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration

svelaga
Posts: 9
Joined: Fri Oct 30, 2015 7:43 pm

Re: Hide soft keyboard in ranorex C# Code

Post by svelaga » Thu Nov 12, 2015 2:55 pm

Add Mobile Key Press action with parameter {DONE}.
Has successfully worked for me

User avatar
odklizec
Ranorex Guru
Ranorex Guru
Posts: 3945
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: Hide soft keyboard in ranorex C# Code

Post by odklizec » Fri Nov 13, 2015 8:54 am

Nice. Thanks for confirmation!
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration