0

我正在对虚拟键盘进行研发(如何捕捉关键事件),但没有发现更多成功我对虚拟键盘的了解很少

我们需要实现

onKeyboradActionListener

/* and these override methode*/

public void onKey(int primaryCode, int[] keyCodes) {
    // TODO Auto-generated method stub

}

@Override
public void onPress(int primaryCode) {
    // TODO Auto-generated method stub

}

@Override
public void onRelease(int primaryCode) {
    // TODO Auto-generated method stub

}

如果有人知道这分享他的知识

4

3 回答 3

0

I am not sure if this might help, but I thought it might be related to your question.

Creating an Input Method

于 2012-07-02T04:41:14.303 回答
0

The below given code might help you...

public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_I) {
        Toast.makeText(getBaseContext(), "You have Clicked the button I", Toast.LENGTH_LONG).show();
    }
    return false;
}
于 2012-07-02T04:44:58.933 回答
0
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) 
{
    if (keyCode == KeyEvent.KEYCODE_MENU) 
    {
        Toast.makeText(getBaseContext(), "You Clike MenuButto", Toast.LENGTH_LONG).show();
        return true;
    }else 
    {
        return false;
    }       
}
于 2012-07-02T05:30:17.410 回答