Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

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

android - 如何禁用代码中的物理键盘(始终使用虚拟键盘)(How to disable physical keyboard in code(use virtual keyboard all the time))

You might ask why do I want that.

(您可能会问我为什么要那样。)

Here is the reason:

(原因如下:)

I used a barcode scanner for the login screen of my application.

(我在应用程序的登录屏幕上使用了条形码扫描仪。)

However connecting the barcode scanner will force my tablet to use the physical keyboard (it thinks the scanner is the keyboard) and that prevents the virtual keyboard from coming up (which I want for some other screens).

(但是,连接条形码扫描仪将迫使我的平板电脑使用物理键盘(它认为扫描仪是键盘),并且这会阻止虚拟键盘出现(我希望用于其他屏幕)。)

I have to manually click on the system bar to disable the physical keyboard for the virtual keyboard to popup.

(我必须手动单击系统栏以禁用物理键盘,虚拟键盘才能弹出。)

So, is there a way to disable the physical keyboard in code or make the virtual keyboard come up even if some "keyboard" is connected?

(因此,有没有办法禁用代码中的物理键盘或使虚拟键盘出现,即使连接了某些“键盘”呢?)

  ask by Han translate from so

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

1 Answer

0 votes
by (71.8m points)

Try the following

(尝试以下)

Settings > Language & Input > Under Keyboard and input methods click Default .

(Settings > Language & Input >在Keyboard and input methods单击Default 。)

Is there an option to to uncheck or disable Hardware/Physical Keyboard?

(是否可以取消选中或禁用硬件/物理键盘?)

It's counter intuitive, but after doing that, I can use both a physical keyboard and the virtual keyboard on my device (Android 4.2)

(这是反直观的,但是这样做之后,我可以在设备(Android 4.2)上同时使用物理键盘和虚拟键盘)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...