Try changing this line:
__set_bit(BTN_TOUCH, codec_ts_input->absbit);
to:
__set_bit(BTN_TOUCH, codec_ts_input->keybit);
And when your pen is up, you should also send an event like:
input_report_key(wm->input_dev, BTN_TOUCH, 0);
Qingzhan Zhang wrote:
still do not work
my init code is
__set_bit(EV_ABS, codec_ts_input->evbit);
__set_bit(EV_KEY, codec_ts_input->evbit);
__set_bit(ABS_X, codec_ts_input->absbit);
__set_bit(ABS_Y, codec_ts_input->absbit);
__set_bit(BTN_TOUCH, codec_ts_input->absbit);
__set_bit(ABS_PRESSURE, codec_ts_input->absbit);
and when pen down
if((x == 0)&&(y == 0)&&(pressure == 0)){
x = last_x;
y = last_y;
} else {
x = ((x- 80)*480)/(1300-80);
y = ((y - 380)*640)/(1600-400);
}
input_report_key(ts->idev,BTN_TOUCH,1);
if (x != last_x) {
printk("the input x value is %d\n",x);
input_report_abs(ts->idev, ABS_X, x);
last_x = x;
}
if (y != last_y) {
printk("the input y value is %d\n",y);
input_report_abs(ts->idev, ABS_Y, y);
last_y = y;
}
if (pressure == last_press)
pressure--;
printk("the pressure is %d\n",pressure);
input_report_abs(ts->idev, ABS_PRESSURE, pressure &
0xfff);
input_sync(ts->idev);
when pen up
printk("input the release event \n");
input_report_abs(ts->idev, ABS_PRESSURE, 0);
On Fri, Dec 12, 2008 at 10:49 AM, Reed Huang
<[email protected]>
wrote:
Correct.
And only send once when the pen hit the touchscreen. like following:
if(!wm->pen_is_down)
input_report_key(wm->input_dev, BTN_TOUCH, 1);
absx = data.x & 0xfff;
absy = data.y & 0xfff;
if(absy > wm->input_dev->absmax[ABS_Y])
absy = wm->input_dev->absmax[ABS_Y];
if(absx > wm->input_dev->absmax[ABS_X])
absx = wm->input_dev->absmax[ABS_X];
input_report_abs(wm->input_dev, ABS_X, absx);
input_report_abs(wm->input_dev, ABS_Y,
(wm->input_dev->absmax[ABS_Y] - absy) +
wm->input_dev->absmin[ABS_Y]);
input_report_abs(wm->input_dev, ABS_PRESSURE, data.p &
0xfff);
input_sync(wm->input_dev);
zhqzh1982 wrote:
you mean i shoul send a BTN_TOUCH pressure event.just like
input_event(ts->idev, EV_ABS, BTN_TOUCH, pressure);?
On 12月12日, 上午9时56分, Reed Huang <[email protected]> wrote:
You need to send BTN_TOUCH event when the pen is down.
Refer to:http://androidzaurus.seesaa.net/article/90045743.html
zhqzh1982 wrote:now i modify the simply calibrate way by x = ((x- 80)*480)/(1300-80); mean the x's value is from 0 to 480 y = ((y - 380)*640)/(1600-400); the y's value is from 0 to 640 the tslib working ok,but android's touchscreen do not work On 12月12日, 上午8时58分, zhqzh1982<[email protected]>wrote:hi my touch pannel driver use input system with event interface when pen down ,i input the x valuer y value and pressure value,just below if((x == 0)&&(y == 0)&&(pressure == 0)){ x = last_x; y = last_y;} else { x = ((x- 80)*240)/(1300-80); y = ((y - 380)*320)/(1600-400); } if (x != last_x) { printk("the input x value is %d\n",x); input_report_abs(ts->idev, ABS_X, x); last_x = x; } if (y != last_y) { printk("the input y value is %d\n",y); input_report_abs(ts->idev, ABS_Y, y); last_y = y; } if (pressure == last_press) pressure--; input_report_abs(ts->idev, ABS_PRESSURE, pressure
& 0xfff); and when pen up i input the pressure value as 0,just below input_report_abs(ts->idev, ABS_PRESSURE, 0); but ,android's touch function do not work ,who can help me thanks
--~--~---------~--~----~------------~-------~--~----~
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting
-~----------~----~----~----~------~----~------~--~---
|