Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
960 views
in Technique[技术] by (71.8m points)

ubuntu - 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...