mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 14:19:09 -04:00
Use s-dt-gesture to report CLI touch gesture
TP: Use s-dt-gesture to report CLI touch gesture. Change-Id: I8f8c488a19ba7e0f535b5f63773d4ae4a5d7b210 Signed-off-by: Wenge Zhu <zhuwg1@motorola.com> Reviewed-on: https://gerrit.mot.com/2415030 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jianqi Yang <yangj@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
754ab91470
commit
9cbd3130c8
1 changed files with 46 additions and 1 deletions
|
|
@ -254,6 +254,51 @@ static int ts_mmi_gesture_handler(struct gesture_event_data *gev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int ts_mmi_cli_gesture_handler(struct gesture_event_data *gev)
|
||||
{
|
||||
int key_code;
|
||||
bool need2report = true;
|
||||
struct ts_mmi_dev *touch_cdev = cli_sensor_pdata->touch_cdev;
|
||||
|
||||
switch (gev->evcode) {
|
||||
case 1:
|
||||
key_code = KEY_F1;
|
||||
pr_info("%s: single tap\n", __func__);
|
||||
break;
|
||||
case 2:
|
||||
key_code = KEY_F2;
|
||||
if(gev->evdata.x == 0)
|
||||
gev->evdata.x = touch_cdev->pdata.fod_x ;
|
||||
if(gev->evdata.y== 0)
|
||||
gev->evdata.y = touch_cdev->pdata.fod_y;
|
||||
input_report_abs(cli_sensor_pdata->input_sensor_dev, ABS_X, gev->evdata.x);
|
||||
input_report_abs(cli_sensor_pdata->input_sensor_dev, ABS_Y, gev->evdata.y);
|
||||
pr_info("%s: zero tap; x=%x, y=%x\n", __func__, gev->evdata.x, gev->evdata.y);
|
||||
break;
|
||||
case 3:
|
||||
key_code = KEY_F3;
|
||||
pr_info("%s: zero tap up\n", __func__);
|
||||
break;
|
||||
case 4:
|
||||
key_code = KEY_F4;
|
||||
pr_info("%s: double tap\n", __func__);
|
||||
break;
|
||||
default:
|
||||
need2report = false;
|
||||
pr_info("%s: unknown id=%x\n", __func__, gev->evcode);
|
||||
}
|
||||
|
||||
if (!need2report)
|
||||
return 1;
|
||||
|
||||
input_report_key(cli_sensor_pdata->input_sensor_dev, key_code, 1);
|
||||
input_sync(cli_sensor_pdata->input_sensor_dev);
|
||||
input_report_key(cli_sensor_pdata->input_sensor_dev, key_code, 0);
|
||||
input_sync(cli_sensor_pdata->input_sensor_dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ts_mmi_palm_handler(bool value)
|
||||
{
|
||||
if (!palm_sensor_pdata->input_sensor_dev)
|
||||
|
|
@ -627,7 +672,7 @@ int ts_mmi_cli_gesture_init(struct ts_mmi_dev *touch_cdev)
|
|||
goto unregister_sensor_input_device;
|
||||
|
||||
/* export report gesture function to vendor */
|
||||
touch_cdev->mdata->exports.report_gesture = ts_mmi_gesture_handler;
|
||||
touch_cdev->mdata->exports.report_gesture = ts_mmi_cli_gesture_handler;
|
||||
|
||||
return 0;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue