1. Download our Official Android App: Forums for Android!

Apps pressed state of a key

Discussion in 'Android Development' started by malay, May 3, 2012.

  1. malay

    malay Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    12
    Joined:
    Jul 5, 2011

    Jul 5, 2011
    12
    0
    15
    How to know whether a particular key (ex-KEYCODE_Q) is pressed or not in android at any instant.

    Is there any API like(GetPressedState(int keycode))??

    Thanks in advance
    MAlaya
     

    Advertisement

  2. wubbzy

    wubbzy Well-Known Member
    Rank:
    None
    Points:
    63
    Posts:
    109
    Joined:
    Dec 19, 2011

    Dec 19, 2011
    109
    32
    63
    *nix kernel's by day
    Silicon Valley
    keyDown/keyUp along with cousins onKeyDown etc.
    Bunch of links for you to read thru:

    View | Android Developers
    KeyEvent | Android Developers

    Does "any instant" mean even when your activity is not on the top?
     

Share This Page

Loading...