简体   繁体   English

如何在SoftKeyBoard上禁用“输入法”?

[英]How to disable “input methods” on SoftKeyBoard?

I know this is not user friendly but i make a kiosk app, so my device will be inside a "container" which will hide the softButtons of the device. 我知道这不是用户友好的,但我做了一个自助服务终端应用程序,所以我的设备将在一个“容器”里面,它将隐藏设备的softButtons。 The problem is: if a user clicks on an "input option" he will never come back to the app, beacuse there is no BackButton . 问题是:如果用户点击“输入选项”,他将永远不会回到应用程序,因为没有BackButton

I just want to know if it's possible to disable the button "input methods" on the default keyboard of my device (NEXUS 10) as you can see in the picture. 我只想知道是否可以在我的设备(NEXUS 10)的默认键盘上禁用“输入法”按钮,如图所示。 If yes: how? 如果是的话:怎么样? Or do I need to write my own keyboard? 或者我需要编写自己的键盘?

I also disabled all other keyboards on my device, but the button is still there. 我还禁用了设备上的所有其他键盘,但按钮仍然存在。

在此输入图像描述

However, on my nexus i don't have this button: 但是,在我的nexus上我没有这个按钮:

在此输入图像描述

UPDATE: 2013-11-07 更新时间:2013-11-07

I noticed that on my nexus I also have the possibility to choose the "input options" settings -> longpress on the comma. 我注意到在我的nexus上我也可以在逗号上选择“输入选项”设置 - > longpress。

So I assume I have to write a softkeyboard on my own. 所以我假设我必须自己写一个软键盘。

I found a solution for my problem and decided to post this as answer, perhaps it will help others. 我找到了解决问题的方法,并决定将其作为答案发布,也许会对其他人有所帮助。

I have to write my own Softkeyboard that has no "Input methods" button. 我必须编写自己的Softkeyboard ,它没有“输入法”按钮。 You can find a good sample at the android samples (note: IME is a feature since 4.0). 您可以在android示例中找到一个好的示例(注意: IME是自4.0以来的一项功能)。

Because of Security reasons I can't select a Softkeyboard programmatically. 由于安全原因,我无法以编程方式选择软键盘。 So I add an additionally setting where the user can choose a Softkeyboard with this code: 所以我添加了一个额外的设置,用户可以使用以下代码选择Softkeyboard

// http://stackoverflow.com/questions/11036435/switch-android-keyboard-profile-programmatically
InputMethodManager imeManager = (InputMethodManager) getActivity().getApplicationContext().getSystemService(Context.INPUT_METHOD_SERVICE);
imeManager.showInputMethodPicker();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM