---
title: "处理按键长按事件"
author: "bashenmail"
date: "2011-02-23T17:54:56Z"
tags: []
categories: ["移动开发"]
slug: "untitled"
draft: false
lastmod: "2011-02-23T17:54:56Z"
id: 920000
url: "https://bashenmail.iteye.com/blog/920000"
---

```
public boolean dispatchKeyEvent(KeyEvent event) {

         if(event.getRepeatCount()>0){

                   //Your code here 
                   return true; //表示已经处理，系统不会处理此事件
                   
         }

         return super.dispatchKeyEvent(event);//表示由系统处理
}
```