예제 #1
0
bool cavan_touch_device_matcher(struct cavan_event_matcher *matcher, void *data)
{
	int ret;
	uint8_t abs_bitmask[ABS_BITMASK_SIZE];
	uint8_t key_bitmask[KEY_BITMASK_SIZE];

	ret = cavan_event_get_abs_bitmask(matcher->fd, abs_bitmask);
	if (ret < 0)
	{
		pr_error_info("cavan_event_get_abs_bitmask");
		return false;
	}

	if (cavan_multi_touch_device_match(abs_bitmask))
	{
		pr_green_info("Deivce %s mutil touch screen", matcher->devname);
		return true;
	}

	ret = cavan_event_get_key_bitmask(matcher->fd, key_bitmask);
	if (ret < 0)
	{
		pr_error_info("cavan_event_get_key_bitmask");
		return false;
	}

	return cavan_single_touch_device_match(abs_bitmask, key_bitmask);
}
예제 #2
0
bool cavan_single_touch_device_matcher(struct cavan_event_matcher *matcher, void *data)
{
	int ret;
	uint8_t abs_bitmask[ABS_BITMASK_SIZE];
	uint8_t key_bitmask[KEY_BITMASK_SIZE];

	ret = cavan_event_get_abs_bitmask(matcher->fd, abs_bitmask);
	if (ret < 0)
	{
		pr_error_info("cavan_event_get_abs_bitmask");
		return false;
	}

	ret = cavan_event_get_key_bitmask(matcher->fd, key_bitmask);
	if (ret < 0)
	{
		pr_error_info("cavan_event_get_key_bitmask");
		return false;
	}

	return cavan_single_touch_device_match(abs_bitmask, key_bitmask);
}
예제 #3
0
파일: input.c 프로젝트: FuangCao/cavan
static struct cavan_input_device *cavan_input_device_create(uint8_t *key_bitmask, uint8_t *abs_bitmask, uint8_t *rel_bitmask)
{
#if CAVAN_INPUT_SUPPORT_GSENSOR
	if (cavan_gsensor_device_match(abs_bitmask)) {
		pr_green_info("G-Sensor Matched");
		return cavan_gsensor_create();
	}
#endif

	if (cavan_touchpad_device_match(key_bitmask, abs_bitmask)) {
		pr_green_info("Touch Pad Matched");
		return cavan_touchpad_device_create();
	}

	if (cavan_multi_touch_device_match(abs_bitmask)) {
		pr_green_info("Muti Touch Panel Matched");
		return cavan_multi_touch_device_create();
	}

	if (cavan_single_touch_device_match(abs_bitmask, key_bitmask)) {
		pr_green_info("Single Touch Panel Matched");
		return cavan_single_touch_device_create();
	}

	if (cavan_mouse_device_match(key_bitmask, rel_bitmask)) {
		pr_green_info("Mouse Matched");
		return cavan_mouse_create();
	}

	if (cavan_keypad_device_match(key_bitmask)) {
		pr_green_info("Keypad Matched");
		return cavan_keypad_create();
	}

	return NULL;
}