开发者

How to intercept keystrokes on the virtual keyboard?

How to intercept button presses virtual keyboard in SurfaceView? Doing so. But nothing is impossible. Help please.

InputMethodManager inputMgr = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVIC开发者_Python百科E);
inputMgr.toggleSoftInput(0, 0);
inputMgr.showSoftInput(mySurface, 0);

public class MySurface extends SurfaceView implements SurfaceHolder.Callback, View.OnTouchListener, OnKeyboardActionListener {...


You should implement TextWatcher class and set it up for all inout fields you are going to control. Unfortunately you can't implement generic soft keyboard presses interception. Look HERE

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜