如何在Android仿真器上使用PC的键盘? -- keyboard 领域 和 android-emulator 领域 android 相关 的问题

How can I use my PC's keyboard on the Android emulator?


简体版||繁體版
141
vote

问题

中文

我想在Android模拟器上运行/测试Android应用程序,我想用我的PC键盘键入,因为它让我键入和测试更快。当我使用仿真器时,它只接受来自原生Android(屏幕)键盘的输入。如何在Android仿真器中启用我的PC键盘?

english

I want to run/test Android apps on the Android emulator and I want to type using my PC keyboard, as it lets me type and test faster. When I use the emulator though, it only accepts input from the native Android (on-screen) keyboard. How can I enable my PC keyboard for use within the Android emulator?

     
       
       

回答列表

120
 
vote

升级开发人员工具后我有同样的问题(v20.0.0v2012 ......)。突然间,我的Android虚拟设备都不会接受我的物理PC / Mac键盘的任何输入。

这是我修复它的方式:

  1. eclipse> Window menu > AVD Manager
  2. 选择您的虚拟设备,然后单击<代码> ABCDEFGHIJKLMNABCDEFGHIJKLMN2
  3. Hardware ,单击 New
  4. 选择 Keyboard Support 然后单击 OK
  5. 将其值编辑为 yes
  6. 现在您必须点击列表中的另一个项目,如"abtract lcd密度" 或其他东西。这似乎使UI保持"是" 的变化。

我的其他没有这个"键盘支持" 硬件属性的AVDS不接受我的物理键盘输入。

 

I had the same issue after upgrading the developer tools (v20.0.0v2012...). All of a sudden none of my android virtual devices would accept any input from my physical PC/Mac keyboard.

This is how I fixed it:

  1. Eclipse > Window menu > AVD Manager
  2. Select your virtual device and click Edit
  3. Under Hardware, Click New
  4. Select Keyboard Support then click OK
  5. Edit its value to yes
  6. Now you have to click off onto another item in the list, like "Abtract LCD Density" or something. This seems to make the UI keep the "yes" change.

My other AVDs that don't have this "keyboard support" hardware property added do NOT accept my physical keyboard input.

 
 
     
     
19
 
vote

请尝试以下设置。我的环境(目标:Android 4.0.3 - API级别15)成功。

AVD - 编辑 - 硬件: - 新... - 键盘支持 - 是

avd - 编辑 - 硬件: - 新的... - 键盘盖支持 - 没有

 

Please try the following settings. My environment (Target: Android 4.0.3 - API Level 15) successful.

AVD - Edit - Hardware: - New... - Keyboard support - yes

AVD - Edit - Hardware: - New... - Keyboard lid support - no

 
 
   
   
10
 
vote

您需要在.android目录中更改config.ini文件。此文件位于主硬盘驱动器目录下。从那里开始,打开AVD文件,您将看到一个虚拟设备列表。打开所需的设备,然后在记事本中打开Config.ini。然后复制此文本:"hw.keyboard = yes" (减去引号),然后保存并关闭。下次打开仿真器时,您应该能够使用键盘。

您还可以在与config.ini的同一目录中打开硬件-qemu.ini文件,然后您可以看到所有硬件选项的列表。将HW.Keyboard从"否" 更改为"是" 。

希望这有帮助!

 

You need to change the config.ini file in your .android directory. This file is found under the main hard drive directory. From there, open the avd file and you will see a list of virtual devices. Open the desired device and then open the config.ini in notepad. Then copy this text: "hw.keyboard = yes" (minus the quotes) and then save and close. The next time you open your emulator, you should be able to use the keyboard.

You can also open up the hardware-qemu.ini file in the same directory as the config.ini and then you can see a list of all the hardware options. Change the hw.keyboard from "no" to "yes".

Hope this helps!

 
 
6
 
vote

此答案是针对从源构建仿真器的人(i.e.从source.android.com的指令中构建仿真器)。您需要在以下文件中修改属性:

  external/qemu/android/avd/hardware-properties.ini   

在该文件的以下部分中将缺省值从否变为yes:

  # Keyboard support (qwerty/azerty) name        = hw.keyboard<br/> type        = boolean<br/> default     = yes<br/> abstract    = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/>   

然后重建(使用make)。至少这为我工作了。

 

This answer is for those who built the emulator from source (i.e. Following instructions from source.android.com). You need to modify a property in the following file:

external/qemu/android/avd/hardware-properties.ini 

In the following section of that file change the default value from no to yes:

# Keyboard support (qwerty/azerty) name        = hw.keyboard<br/> type        = boolean<br/> default     = yes<br/> abstract    = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/> 

Then rebuild (using make). At least this worked for me.

 
 
 
 
4
 
vote

我有这个问题尽管有正确的配置,并且意识到实际问题是,焦点在仿真器控制按钮窗口上,如此问题。

要检查此问题是否是您的问题,请参阅按下空间是否实际按下其中一个按钮,如果按Tab移动仿真器控件中的元素之间的高亮焦距方形。如果这是问题,那么你应该能够如下工作:
  • 选择仿真器控件中的"扩展控件" ("..." 按钮)
  • 通过单击
  • 更改为扩展控件窗口中的任何项目
  • 关闭扩展控件窗口

焦点现在应该返回主Android仿真器窗口,而不是仿真器控件,并且键压应转到Android应用程序。

 

I had this issue despite having the correct configuration, and realized that the actual problem was that the focus was on the emulator control buttons windows, as reported in this issue.

To check if this is your problem, see if pressing space actually presses one of those buttons, and if pressing tab moves the highlight focus square between elements in the emulator controls. If that is the problem, then you should be able to work around it as follows:

  • Select the extended controls (The "..." button in the emulator controls)
  • Change to any item in the extended controls window by clicking
  • Close the extended controls window

The focus should now return to the main Android emulator window, not the emulator controls, and key presses should go to Android apps.

 
 
 
 
0
 
vote

在此处指示,应为AVD仿真器实例启用PC键盘。判断仿真器页面

 

As a few have indicated here, the PC keyboard should be enabled for the AVD Emulator instances. Judging by what the emulator page on Android Developer says about key commands and such, it does not appear there is a way to enable/disable PC keyboard usage within the SDK. Your best bet is re-installing the SDK then, and try again.

 
 
 
 
0
 
vote

尝试 ctrl + f11 或numpad 7 。这应该启用键盘,除非从其他地方禁用。

 

Try Ctrl + F11 or NumPad 7. That should enable your keyboard, unless is disabled from somewhere else.

 
 
         
         
0
 
vote

如果使用 Xamarin.Android Visual Studio 2010 中,您可以启用 Keyboard Support 如下:

  1. 关闭您的AVD
  2. 在VS2010中,转到 Tools > Start Android Emulator Manager
  3. 选择 AVD Name 要添加 Keyboard Support ,然后单击 Edit 按钮
  4. Hardware 区域中,单击 # Keyboard support (qwerty/azerty) name = hw.keyboard<br/> type = boolean<br/> default = yes<br/> abstract = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/> 0 按钮
  5. # Keyboard support (qwerty/azerty) name = hw.keyboard<br/> type = boolean<br/> default = yes<br/> abstract = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/> 1 下拉列表中,选择 # Keyboard support (qwerty/azerty) name = hw.keyboard<br/> type = boolean<br/> default = yes<br/> abstract = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/> 2 ,然后单击 # Keyboard support (qwerty/azerty) name = hw.keyboard<br/> type = boolean<br/> default = yes<br/> abstract = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/> 3 按钮
  6. # Keyboard support (qwerty/azerty) name = hw.keyboard<br/> type = boolean<br/> default = yes<br/> abstract = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/> 4 # Keyboard support (qwerty/azerty) name = hw.keyboard<br/> type = boolean<br/> default = yes<br/> abstract = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/> 5 被添加到 # Keyboard support (qwerty/azerty) name = hw.keyboard<br/> type = boolean<br/> default = yes<br/> abstract = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/> 6 列表中。更改 # Keyboard support (qwerty/azerty) name = hw.keyboard<br/> type = boolean<br/> default = yes<br/> abstract = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/> 7 # Keyboard support (qwerty/azerty) name = hw.keyboard<br/> type = boolean<br/> default = yes<br/> abstract = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/> 8 # Keyboard support (qwerty/azerty) name = hw.keyboard<br/> type = boolean<br/> default = yes<br/> abstract = Keyboard support<br/> description = Whether the device has a QWERTY keyboard.<br/> 9
  7. 单击 Xamarin.Android0 按钮

屏幕截图"编辑Android虚拟设备" 窗口

 

If you are using Xamarin.Android in Visual Studio 2010, you can enable Keyboard Support as follows:

  1. Close your AVD
  2. In VS2010, go to Tools > Start Android Emulator Manager
  3. Select the AVD Name that you want to add Keyboard Support for, then click the Edit button
  4. In the Hardware area, click the New button
  5. In the Property dropdown, select Keyboard support, then click the OK button
  6. The Keyboard support Property is added to the Hardware list. Change the Value from No to Yes
  7. Click the Edit AVD button

Screenshot of "Edit Android Virtual Device" window

 
 

相关问题

0  在仿真器上运行自定义ROM文件  ( Run custom rom files on emulator ) 
我想在Windows PC的Android仿真器上运行不同的手机模型的ROM文件。 你知道我该怎么办?我知道如何为英特尔和ARM运行标准的Android模拟器,但是我想运行生产ROM文件。 ...

0  罐子“不存在SD卡”  ( Jar of beans sd card not exist ) 
我安装了葡萄酒和ran"jar的beans.exe" 。它成功加载了。我尝试通过单击"设置" ,UMPTEN时间创建SD卡。但是,它说"不存在SD卡" 。此外,有一个按钮"启动Android默认值" 或"开始Android AneSh" ,具体取决于Android虚拟设备的名称。我在徒劳的时候点击了它。 此外,我尝试...

141  如何在Android仿真器上使用PC的键盘?  ( How can i use my pcs keyboard on the android emulator ) 
我想在Android模拟器上运行/测试Android应用程序,我想用我的PC键盘键入,因为它让我键入和测试更快。当我使用仿真器时,它只接受来自原生Android(屏幕)键盘的输入。如何在Android仿真器中启用我的PC键盘? ...

1  无法在Windows 7中启动仿真Android设备/ AVD设备  ( Cannot start emulated android device avd device in windows 7 ) 
我遵循官方android指南这里但我无法启动仿真设备。它一直在说 PANIC Cannot start device... 如下面的屏幕截图。 你有同样的问题,对我有任何工作吗? 创建设备 启动设备 恐慌/失败结果 ...

2  将仿真器重新连接到Eclipse  ( Reconnecting emulator to eclipse ) 
我在Android中开发的主要问题是仿真器似乎不断地与Eclipse断开连接。这始终发生在2-3的时间我尝试从Eclipse上传我的.apk而不重新启动仿真器。 Eclipse表示这与空DDMS - &gt;设备部分和logcat保持空白 - 有时我不确定新代码是否在设备上使其成为。 我所拥有的唯一修复是关闭Ecl...

5  adb列出所有转发端口  ( Adb listing all forwarded ports ) 
我使用以下命令将机器端口转发给模拟器 adb转发tcp:1234 TCP:8080 我想查看目前所有端口的转发方式以避免任何冲突。怎么做? ...

0  阻止应用程序安装在AVD环境中?  ( Blocking apps to be installed in avd environment ) 
开发人员是否可能阻止他们的Google Play应用程序在AVD安装,或者我只是选择不支持的AVD配置文件?我正在尝试将应用程序安装到AVD并在更受控的环境中调试,但是,它说: 您的设备与此版本不兼容 所以,它不是错误消息。在安装应用程序之前它是Google播放消息。 ...

2  是否有可能使用图像/视频文件作为模拟相机?  ( Would it be possible to use a image video file as an emulated camera ) 
嗨,我想知道是否有可能"欺骗" 一个真实或模拟的Android设备,以便认为图像或视频文件是相机馈送。这样你就可以打开一个像Snapchat那样的应用程序,它从相机饲料中取出内容并按记录,并且它将记录您选择的任何文件。我想这可能在模拟的Android设备上更容易,但我不确定。 ...

1  avd nexus_5x_api_22的仿真器进程被杀死  ( The emulator process for avd nexus 5x api 22 was killed ) 
我安装了Android Studio与offical网站的Android SDK,创建了一个新的示例项目,没有改变或删除甚至一行,但随时随地无法正常工作。 D:AndSDK oolsemulator.exe -netdelay none -netspeed full -avd Nexus_5X_API_22 H...

2  在AOSP自定义构建仿真器中使用软件键盘  ( Using software keyboard in aosp custom build emulator ) 
我终于能够建立自己的AOSP图像,我想调试软件键盘的一些问题。但是,默认模拟器具有模拟物理键盘,我不知道如何禁用它。 我知道Android SDK允许在创建AVD时禁用键盘,但我只能为SDK带来的平台创建这样的AVDS,而不是我自己的构建。 ...




© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有