Exemplo n.º 1
0
bool huamobile_multi_touch_device_match(uint8_t *abs_bitmask)
{
	if (test_bit(ABS_MT_POSITION_X, abs_bitmask) == 0 || test_bit(ABS_MT_POSITION_Y, abs_bitmask) == 0) {
		return false;
	}

	clean_bit(ABS_MT_POSITION_X, abs_bitmask);
	clean_bit(ABS_MT_POSITION_Y, abs_bitmask);

	return true;
}
Exemplo n.º 2
0
bool huamobile_single_touch_device_match(uint8_t *abs_bitmask, uint8_t *key_bitmask)
{
	if (test_bit(BTN_TOUCH, key_bitmask) == 0 || test_bit(ABS_X, abs_bitmask) == 0 || test_bit(ABS_Y, abs_bitmask) == 0) {
		return false;
	}

	clean_bit(BTN_TOUCH, key_bitmask);
	clean_bit(ABS_X, abs_bitmask);
	clean_bit(ABS_Y, abs_bitmask);

	return true;
}
Exemplo n.º 3
0
bool huamobile_gsensor_device_match(uint8_t *abs_bitmask)
{
	if (test_bit(ABS_X, abs_bitmask) == 0 || \
		test_bit(ABS_Y, abs_bitmask) == 0 || \
		test_bit(ABS_Z, abs_bitmask) == 0) {
		return false;
	}

	clean_bit(ABS_X, abs_bitmask);
	clean_bit(ABS_Y, abs_bitmask);
	clean_bit(ABS_Z, abs_bitmask);

	return true;
}
Exemplo n.º 4
0
bool huamobile_mouse_device_match(uint8_t *key_bitmask, uint8_t *rel_bitmask)
{
	if (test_bit(BTN_LEFT, key_bitmask) == 0 || \
		test_bit(BTN_RIGHT, key_bitmask) == 0 || \
		test_bit(REL_X, rel_bitmask) == 0 || \
		test_bit(REL_Y, rel_bitmask) == 0)
	{
		return false;
	}

	clean_bit(BTN_LEFT, key_bitmask);
	clean_bit(BTN_RIGHT, key_bitmask);
	clean_bit(REL_X, rel_bitmask);
	clean_bit(REL_Y, rel_bitmask);

	return true;
}
Exemplo n.º 5
0
static bool cavan_keypad_event_handler(struct cavan_input_device *dev, struct input_event *event, void *data)
{
#if CONFIG_CAVAN_KEYPAD_DROP_REPORT
	bool pressed, keydown;
#endif
	struct cavan_keypad_device *keypad = (struct cavan_keypad_device *) dev;

	switch (event->type) {
	case EV_KEY:
#if CONFIG_CAVAN_KEYPAD_DROP_REPORT
		keydown = event->value > 0;
		pressed = test_bit(event->code, keypad->key_bitmask) != 0;
		if (pressed != keydown)
#endif
		{
			const char *keyname;

#if CONFIG_CAVAN_KEYPAD_DROP_REPORT
			if (keydown) {
				set_bit(event->code, keypad->key_bitmask);
			} else {
				clean_bit(event->code, keypad->key_bitmask);
			}
#endif

			keyname = cavan_event_find_key_name(dev->event_dev, event->code);
			cavan_input_service_append_key_message(data, \
					CAVAN_INPUT_MESSAGE_KEY, keyname, event->code, event->value);
		}
		break;

	case EV_SYN:
		break;

	default:
		return false;
	}

	return true;
}
Exemplo n.º 6
0
bool cavan_touchpad_device_match(uint8_t *key_bitmask, uint8_t *abs_bitmask)
{
	if (test_bit(BTN_LEFT, key_bitmask) == 0 || \
		test_bit(BTN_RIGHT, key_bitmask) == 0 || \
		test_bit(BTN_TOUCH, key_bitmask) == 0 || \
		test_bit(ABS_X, abs_bitmask) == 0 || \
		test_bit(ABS_Y, abs_bitmask) == 0)
	{
		return false;
	}

	clean_bit(BTN_LEFT, key_bitmask);
	clean_bit(BTN_RIGHT, key_bitmask);
	clean_bit(BTN_MIDDLE, key_bitmask);
	clean_bit(BTN_TOUCH, key_bitmask);
	clean_bit(ABS_X, abs_bitmask);
	clean_bit(ABS_Y, abs_bitmask);

	return true;
}