![]() It turns out there’s a CSS property called touch-action that lets a web developer specify the panning/pinch-zoom behavior in their web app. CSS “touch-action”, passive events, and moreĪfter my digression into the world of operating system multi-touch support, I decided to see if I missed anything in the browser. Okay, time to go back up to the web/browser tier and see if I missed something. In short, there is no way to disable multi-touch at the Linux operating system level without recompiling the kernel with multi-touch off. You can learn more about the multi-touch protocol here on the kernel docs. Using tools like mtdev-test, I was able to watch streaming touch events, which are what Chromium uses to receive touch input. I learned about the Linux MT Protocol, which standardizes events like ABS_MT coming from evdev. My next step was to go deeper and understand how multi-touch events work at the evdev level. However, this is not the case for the proprietary Chromium-based player, but that doesn’t change the fact that xinput does not help us. You can see that by using xinput test and comparing something like gedit to Chromium with touch activity.Ĭomparing xinput test between gedit and Chromium on Ubuntu 16.04 LTS It does have the capability to adjust touchpad gestures, but that isn’t applicable here.įurthermore, at least as of Ubuntu 16.04 LTS with Chromium v71, it appears that Chromium listens directly to evdev (event device) rather than xinput for touch events. While xinput does have configuration options, such as applying a TransformationMatrix to rotate your touchscreen, it does not have the ability to adjust or turn on/off multi-touch for a given touchscreen. This includes pointers (mice, touchpads, etc.), touch in general, and multi-touch. First: for most standard Linux setups, input goes through xinput. A word of caution as well: while this section seems brief, it involved looking at both Chromium and kernel source code, which while awesome from a learning perspective, they are both time consuming!Īfter my failure at the Chromium/CEF level, my next question was: can you modify/disable multi-touch support on Linux? This is how it works for pointing devices, like mice. ![]() Some background: in general, when you’re using X Window System on Linux, input goes through xinput before going to your apps. The rabbit hole of Linux multi-touch support Queue the Inception music: it’s time to go deeper. These also don’t work on the proprietary player we use □ It doesn’t appear to be documented anywhere that you need to use both of these flags together, rather than just -enable-viewport by itself In particular, this led to an interesting alternative: you can pass -enable-viewport and -enable-experimental-web-platform-features, which will allow you to use the experimental CSS properties, which have the same effect as the viewport meta tag on mobile. I started to explore other Chromium flags in the hopes that the player we use would allow them to work. Now, based on some cursory reading, it looked like CEF might support command-line flags, but the player we use would have to support them as well. But here’s the twist: we don’t use Chromium itself we use a proprietary player that uses Chromium Embedded Framework (CEF). It looked like I found a solution! Just pass -disable-pinch as a startup flag, and all will work magically. Would a simple startup flag work? Let’s find out. It turns out there are many less-than-perfectly documented Chromium flags, which can be found on this list that is automatically generated from the Chromium codebase. While I did end up trying a JavaScript solution, we’ll come back to that later!Īs I started focusing on kiosk-related solutions, such as this post, it seemed like there might be a better way to just disable the pinch-zoom gesture at the page level, while leaving it intact for components, such as a map, that might need it. Many users rely on this capability in order to access content, including small, hard-to-read text. This change is important because there are accessibility concerns related to zooming on web pages and apps. While a lot of solutions found online would have worked before, as of Chromium v51, event listeners are now passive by default, which means they don’t automatically block behavior. Some solutions, such as this post on Stack Overflow, are a bit out of date. What have others done? Do the JavaScript event tricks I’ve used in the past still work? How have folks solved this for Chromium-based kiosks in the past? ![]() It started with some searchingĪs many engineers do, I started out by searching in the problem space. ![]() This seemingly simple question turned into quite the rabbit hole! Here’s the journey we went through.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |