K
K
kirawa2014-12-11 13:31:25
Android
kirawa, 2014-12-11 13:31:25

How to track clicks on the virtual keyboard?

editText.setOnKeyListener(new View.OnKeyListener() {
            public boolean onKey(View v, int keyCode, KeyEvent event) {
                if ((event.getAction() == KeyEvent.ACTION_DOWN) &&
                        (keyCode == KeyEvent.KEYCODE_ENTER)) {
                    setMarker(editText);
                    return true;
                }
                return false;
            }
        });

A custom EditText component drawn on a Canvas.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question