From 5fa2773c33c84cc36dc224aba1202e4ac1ce4178 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E7=BD=97=E4=BC=9F?= Date: Tue, 8 Jun 2010 02:44:41 +0000 Subject: [PATCH] modify the play key --- drivers/input/keyboard/rk2818_adckey.c | 32 ++++++++++++++++---------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/drivers/input/keyboard/rk2818_adckey.c b/drivers/input/keyboard/rk2818_adckey.c index 44f308963487..4ef0c121682e 100644 --- a/drivers/input/keyboard/rk2818_adckey.c +++ b/drivers/input/keyboard/rk2818_adckey.c @@ -26,7 +26,7 @@ #include #include -#if 0 +#if 1 #define DBG(x...) printk(x) #else #define DBG(x...) @@ -188,26 +188,34 @@ static void rk28_adkeyscan_timer(unsigned long data) { if((++gPlayCount > 2) && (gFlagShortPlay == 0)) { - input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_SHORT_PRESS,1); - input_sync(pRk28AdcKey->input_dev); - input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_SHORT_PRESS,0); - input_sync(pRk28AdcKey->input_dev); gFlagShortPlay = 1; - DBG("Enter::%s,LINE=%d,KEY_PLAY_SHORT_PRESS=%d\n",__FUNCTION__,__LINE__,KEY_PLAY_SHORT_PRESS); + } else if((++gPlayCount > 100) && (gFlagLongPlay == 0)) { - input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_LONG_PRESS,1); - input_sync(pRk28AdcKey->input_dev); - input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_LONG_PRESS,0); - input_sync(pRk28AdcKey->input_dev); gFlagLongPlay = 1; - gPlayCount = 0; - DBG("Enter::%s,LINE=%d,KEY_PLAY_LONG_PRESS=%d\n",__FUNCTION__,__LINE__,KEY_PLAY_LONG_PRESS); + } } else { + if(gPlayCount > 100) + { + input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_LONG_PRESS,1); + input_sync(pRk28AdcKey->input_dev); + input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_LONG_PRESS,0); + input_sync(pRk28AdcKey->input_dev); + DBG("Enter::%s,LINE=%d,KEY_PLAY_SHORT_PRESS=%d\n",__FUNCTION__,__LINE__,KEY_PLAY_SHORT_PRESS); + } + else if (gPlayCount > 2) + { + input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_SHORT_PRESS,1); + input_sync(pRk28AdcKey->input_dev); + input_report_key(pRk28AdcKey->input_dev,KEY_PLAY_SHORT_PRESS,0); + input_sync(pRk28AdcKey->input_dev); + DBG("Enter::%s,LINE=%d,KEY_PLAY_LONG_PRESS=%d\n",__FUNCTION__,__LINE__,KEY_PLAY_LONG_PRESS); + } + gFlagShortPlay = 0; gFlagLongPlay = 0; gPlayCount = 0; -- 2.34.1