Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android AVD keyboard input not working all the time on xUbuntu OS

I have a weird behavior on my xubuntu machine and I don't know why.

  1. Start the emulator and have a EditText in the app.
  2. Tap on EditText and the android keyboard pops up
  3. Tap keys on my PC's hardware keyboard but no input on the emulator.
  4. Now here is the weird part, tap on the 3 dots menu of the emulator settings: enter image description here

  5. The settings screen opens, for instance with the Locations setting which does have an input field for Longitude. I close the screen

  6. Now the input of my PC's keyboard works on the emulator.

So, basically only after doing these steps I can input in the emulator using my keyboard. If I go back to Android Studio and type something, when I return to the emulator, it does not work. How can I make the input work all the time?

like image 546
Alin Avatar asked Oct 12 '16 07:10

Alin


People also ask

How do I enable keyboard controls on my emulator?

Click on the “Select IME” option. From the “Select IME” menu, find the “Enable On-screen Keyboard” option. Click on the slider beside “Enable On-screen Keyboard” to enable it. Note: Your physical keyboard will not work once the virtual keyboard is enabled.

What type of keyboard and buttons do the Android emulators have?

What type of keyboard and buttons do the Android Emulators have? ​ Android Emulators have software buttons and a hardware keyboard. In a regular Android Emulator the device buttons are software buttons displayed on the right size of the emulator.


2 Answers

You see, the main case is Android Emulator Window don't have the proper focus even when you click on it. Yes, you can do any touch-operations, but frame still appears non-focused.

I've found a workaround for that:

  1. Go to your Window Manager
  2. Find Focus tab
  3. Change Focus Model -> "Focus follow mouse"
  4. (Optional) Apply proper delay (I've put it to the lowest value)
  5. Disable "Automatically raise windows when they receive focus" option bellow.

Now, whenever you hang your cursor above the emulator window it'll gain correct focusing state and you'd be able to use you keyboard just fine.

like image 146
Paul Freez Avatar answered Jan 01 '23 08:01

Paul Freez


On Ubuntu 18.04 and 19.04 this happens when you have multiple keyboard layouts installed on your system. Try to select your first keyboard layout from the list to make virtual keyboard work in emulator.

Strangely, it doesn't matter which particular layout you have selected, or if it matches with language in the emulator, but looks like it is related to the position of the keyboard layout in the list.

like image 32
zub0r Avatar answered Jan 01 '23 07:01

zub0r