开发者

Android virtual keyboard - catch Shift+enter events

Is there a way to catch shift+enter events from android virtual keyboard? For now i am trying to use

private OnKeyListener editTextMessageKeyListener= new OnKeyListener() {
    public boolean onKey(View v, int keyCode, KeyEvent event) {
        if ((event.getAction() == KeyEvent.ACTION_DOWN) &&
            (event.isShiftPressed())&&
            (keyCode == KeyEvent.KEYCODE_ENTER)) 
        {
            addPhoneToList();
            se开发者_JAVA百科ndMessageToUsers();
        return true;
        }
        return false;
};
};

But whenever I press enter or shift-enter, event.isShiftPressed() is always false... This time virtual keyboard shows that shift IS pressed, so somethere inside it there is a shift state maintain - how can i get it? My phone is HTC Sensation with htc sense 3 default keyboard installed.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜