Get key state

Put your problem here if it does not fit any of the other categories.

Get key state

Postby Vinc » Sun Mar 01, 2009 9:12 pm

Hi,

is there any method to get the key states? (like JME GameCanvas.getKeyStates())

Thanks
Vinc
Once Poster
Once Poster
 
Posts: 1
Joined: Sun Mar 01, 2009 9:00 pm

Top

Postby metachris » Mon Mar 02, 2009 1:21 am

something like this?
Code: Select all
EditText t1 = (EditText) findViewById(R.id.EditText01);
t1.setOnKeyListener(new EditText.OnKeyListener() {
    public boolean onKey(View v, int keyCode, KeyEvent event) {
        Log.v("MyApp", "Key Event: " + keyCode);
        return false;
   }
});
metachris
Junior Developer
Junior Developer
 
Posts: 24
Joined: Sat Feb 07, 2009 11:40 am

Re: Get key state

Postby MrSnowflake » Mon Mar 02, 2009 9:44 am

Vinc wrote:is there any method to get the key states? (like JME GameCanvas.getKeyStates())
You should make the architectures, which gives you all the keys pressed, yourself. But it's not hard at all.
User avatar
MrSnowflake
Moderator
Moderator
 
Posts: 1439
Joined: Sat Feb 16, 2008 3:11 pm
Location: Flanders, Belgium

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 20 guests