Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Use the onKeyDown() events to trigger each response and onKeyUp() events to finish them.</p> <p><a href="http://developer.android.com/reference/android/view/KeyEvent.html" rel="nofollow">http://developer.android.com/reference/android/view/KeyEvent.html</a></p> <p><a href="http://developer.android.com/reference/android/view/KeyEvent.Callback.html" rel="nofollow">http://developer.android.com/reference/android/view/KeyEvent.Callback.html</a></p> <p>For touchs, you can use the OnTouchListener</p> <p><a href="http://developer.android.com/reference/android/view/View.OnTouchListener.html" rel="nofollow">http://developer.android.com/reference/android/view/View.OnTouchListener.html</a></p> <p>and determine the kind of touch by the MotionEvent:</p> <p><a href="http://developer.android.com/reference/android/view/MotionEvent.html" rel="nofollow">http://developer.android.com/reference/android/view/MotionEvent.html</a></p> <p>To clarify my response: To make a sound while holding one button, you can start the sound when the <code>ACTION_DOWN</code> action in the <code>MotionEvent</code> event is triggered and stop it with the <code>ACTION_UP</code> action of the same event.</p> <ul> <li>Create a class extending View where you're holding all your buttons. </li> <li>Override the onTouchEvent vor that class. </li> <li>Switch between the different actions.</li> <li>Use event.getX() and event.getY() to figure out where the touch event was originated.</li> <li>Check which button is located at that position</li> <li>Play the sound accordingly.</li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload