开发者

How to intercept keystrokes on the virtual keyboard?

开发者 https://www.devze.com 2023-03-15 06:26 出处:网络
How to intercept button presses virtual keyboard in SurfaceView? Doing so. But nothing is impossible. Help please.

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

精彩评论

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