When move finger to left, the mouse will move to right.
Signed-Off-By Quanxian Wang <quanxian.wang@intel.com>
--- /dev/null
+ATTRS{idVendor}=="0eef", ATTRS{idProduct}=="0001", ENV{WL_QUIRK_SWAP_XAXIS}="yes"
Source4: rc.weston
Source5: weston.sh
Source6: weston.manifest
+Source7: 99-chelong-quirk.rules
BuildRequires: pkgconfig(wayland-server)
BuildRequires: pkgconfig(egl)
BuildRequires: pkgconfig(gl)
# Systemd
mkdir -p $RPM_BUILD_ROOT/%{_libdir}/systemd/system/graphical.target.wants
install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT/%{_libdir}/systemd/system/
-mkdir -p $RPM_BUILD_ROOT/%{_libdir}/udev/rules.d/
-install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/%{_libdir}/udev/rules.d/
+mkdir -p $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d/
+install -m 0644 %{SOURCE3} $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d/
+install -m 0644 %{SOURCE7} $RPM_BUILD_ROOT/%{_sysconfdir}/udev/rules.d/
ln -sf ../weston.service $RPM_BUILD_ROOT/%{_libdir}/systemd/system/graphical.target.wants/weston.service
# System V
%{_datadir}/man/*/*
%{_libdir}/systemd/system/weston.service
%{_libdir}/systemd/system/graphical.target.wants/weston.service
-%{_libdir}/udev/rules.d/99-vtc1000-quirk.rules
+%{_sysconfdir}/udev/rules.d/*
%{_sysconfdir}/profile.d/weston.sh
%{_sysconfdir}/rc.d/init.d/weston
%{_sysconfdir}/rc.d/rc3.d/S20weston
{
if (udev_device_get_property_value(udev_device, "WL_QUIRK_SWAP_AXES"))
evdev_device->quirks |= EVDEV_QUIRK_SWAP_AXES;
+ else if (udev_device_get_property_value(udev_device, "WL_QUIRK_SWAP_XAXIS"))
+ evdev_device->quirks |= EVDEV_QUIRK_SWAP_XAXIS;
}
static const char default_seat[] = "seat0";
const int screen_width = device->output->current->width;
const int screen_height = device->output->current->height;
- if (device->quirks & EVDEV_QUIRK_SWAP_AXES) {
- switch (e->code) {
- case ABS_X:
+ switch (e->code) {
+ case ABS_X:
+ if (device->quirks & EVDEV_QUIRK_SWAP_AXES) {
device->abs.y =
(e->value - device->abs.min_y) * screen_height /
(device->abs.max_y - device->abs.min_y) +
device->output->y;
- device->pending_events |= EVDEV_ABSOLUTE_MOTION;
- break;
- case ABS_Y:
+ } else if (device->quirks & EVDEV_QUIRK_SWAP_XAXIS) {
+ device->abs.x =
+ (device->abs.max_x - (e->value - device->abs.min_x)) * screen_width /
+ (device->abs.max_x - device->abs.min_x) +
+ device->output->x;
+ } else {
+ /* Normally Process Y */
device->abs.x =
(e->value - device->abs.min_x) * screen_width /
(device->abs.max_x - device->abs.min_x) +
device->output->x;
- device->pending_events |= EVDEV_ABSOLUTE_MOTION;
- break;
}
-
- } else {
- switch (e->code) {
- case ABS_X:
+ break;
+ device->pending_events |= EVDEV_ABSOLUTE_MOTION;
+ case ABS_Y:
+ if (device->quirks & EVDEV_QUIRK_SWAP_AXES) {
device->abs.x =
(e->value - device->abs.min_x) * screen_width /
(device->abs.max_x - device->abs.min_x) +
device->output->x;
- device->pending_events |= EVDEV_ABSOLUTE_MOTION;
- break;
- case ABS_Y:
+ } else {
+ /* Normally Process Y */
device->abs.y =
(e->value - device->abs.min_y) * screen_height /
(device->abs.max_y - device->abs.min_y) +
device->output->y;
- device->pending_events |= EVDEV_ABSOLUTE_MOTION;
- break;
}
+ device->pending_events |= EVDEV_ABSOLUTE_MOTION;
+ break;
}
}
enum evdev_device_quirks {
EVDEV_QUIRK_NONE = 0,
EVDEV_QUIRK_SWAP_AXES = (1 << 0),
+ EVDEV_QUIRK_SWAP_XAXIS = (2 << 0),
};
struct evdev_device {