-
-
Save anonymous/f999cb88cdf75079deda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/xbmc/input/linux/LinuxInputDevices.cpp b/xbmc/input/linux/LinuxInputDevices.cpp | |
index 0b0f7ae..6afe0c0 100644 | |
--- a/xbmc/input/linux/LinuxInputDevices.cpp | |
+++ b/xbmc/input/linux/LinuxInputDevices.cpp | |
@@ -275,6 +275,8 @@ typedef enum | |
static char remoteStatus = 0xFF; // paired, battery OK | |
+static char touchclick = 0; | |
+ | |
CLinuxInputDevice::CLinuxInputDevice(const std::string fileName, int index) | |
{ | |
m_fd = -1; | |
@@ -496,6 +498,11 @@ bool CLinuxInputDevice::KeyEvent(const struct input_event& levt, XBMC_Event& dev | |
case BTN_TOUCH: | |
devt.button.button = XBMC_BUTTON_LEFT; | |
+ | |
+ /* Ignore touch and trigger it when both coordinates are received */ | |
+ touchclick = levt.value; | |
+ if (levt.value) return false; | |
+ | |
break; | |
case BTN_TOOL_DOUBLETAP: | |
@@ -603,11 +610,11 @@ bool CLinuxInputDevice::AbsEvent(const struct input_event& levt, XBMC_Event& dev | |
switch (levt.code) | |
{ | |
case ABS_X: | |
- m_mouseX = levt.value; | |
+ m_mouseX = (levt.value * 1920) / 32768; | |
break; | |
case ABS_Y: | |
- m_mouseY = levt.value; | |
+ m_mouseY = (levt.value * 1080) / 32768; | |
break; | |
case ABS_MISC: | |
@@ -628,6 +635,17 @@ bool CLinuxInputDevice::AbsEvent(const struct input_event& levt, XBMC_Event& dev | |
devt.motion.yrel = 0; | |
devt.motion.which = m_deviceIndex; | |
+ if (touchclick && levt.code == ABS_Y) { | |
+ touchclick = 0; | |
+ devt.type = XBMC_MOUSEBUTTONDOWN; | |
+ devt.button.type = devt.type; | |
+ devt.button.which = m_deviceIndex; | |
+ devt.button.button = XBMC_BUTTON_LEFT; | |
+ devt.button.state = XBMC_PRESSED; | |
+ devt.button.x = m_mouseX; | |
+ devt.button.y = m_mouseY; | |
+ } | |
+ | |
return true; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment