Android examples for User Interface:Key Event
Checks whether the given Key event is an ACTION_DOWN event.
// Copyright 2012 The Chromium Authors. All rights reserved. //package com.java2s; import android.view.KeyEvent; public class Main { /**//from www. ja va2 s .c o m * Checks whether the given event is an ACTION_DOWN event. * @param event Event to be checked. * @return Whether the event is an ACTION_DOWN event. */ public static boolean isActionDown(KeyEvent event) { return event.getAction() == KeyEvent.ACTION_DOWN; } }