1 |
Richard Yao posted on Sat, 12 Sep 2015 17:24:41 +0000 as excerpted: |
2 |
|
3 |
> I asked in #gentoo-embedded on freenode, but I would like to pose this |
4 |
> question to a wider auidence through the list. |
5 |
> |
6 |
> What is the status of phone/tablet support? In specific, I am curious |
7 |
> about: |
8 |
> |
9 |
> * Modern hardware options (especially those without a hardware keyboard) |
10 |
> * Status of F/OSS drivers |
11 |
> * Xorg touch support (multitouch, virtual keyboards, etcetera) |
12 |
> * Desktop environments designed for multitouch in portage |
13 |
> * Graphical applications (e.g. dialer, calendar, web browser, |
14 |
> email client) |
15 |
> * Reliable filesystem options for flash storage in small memory |
16 |
> environments. |
17 |
|
18 |
I've actually been thinking about replacing my (dearly departed) netbook |
19 |
with a tablet (x86_64-based, for me, the idea being single-build and |
20 |
share packages across machines where possible), so I too am interested. |
21 |
|
22 |
Meanwhile, I can already answer one, multitouch, at least to some extent, |
23 |
in the positive, based on my own experience, with more limited comments |
24 |
on some of the others, as well. |
25 |
|
26 |
[TL;DR: just stop reading here.] |
27 |
|
28 |
As it so happens, I have a touchpad (Logitech t650) attached to my |
29 |
workstation, here. The kernel supports the hardware from 3.16 or 3.18, |
30 |
IIRC; before that it didn't /quite/ work, but some others did. |
31 |
|
32 |
The xorg driver choices are xf86-input-evdev, -synaptics, and -mtrack. |
33 |
-evdev doesn't work well without hardware buttons, however, so that |
34 |
leaves -synaptics, and -mtrack. |
35 |
|
36 |
xf86-input-synaptics is the more mature of the two and works reasonably |
37 |
well, but is relatively limited in the number of gestures it recognizes. |
38 |
OTOH, it can use pressure as a Z axis, often controlling speed or brush- |
39 |
width, for example, while mtouch doesn't. As a mature driver, it has a |
40 |
manpage, and additional optional apps such as a kcontrol (aka kde system |
41 |
settings) applet. It's limited to the standard seven "button" events, |
42 |
however, that being its biggest drawback, for me. |
43 |
|
44 |
xf86-input-mtrack is what I'm using, and am quite happy with, tho being |
45 |
less mature it has a readme instead of a manpage, and is otherwise less |
46 |
commonly supported (no kcontrol applet for it, for example). It supports |
47 |
far more gestures, and can work in either relative mode, which is what |
48 |
I'm using with my touchpad, or absolute mode, which a number of users |
49 |
reported works quite well on their touch-screens. |
50 |
|
51 |
What mtrack does for gestures is translate them into xorg button events, |
52 |
registering up to 20 "buttons", depending on which gestures you have |
53 |
configured. |
54 |
|
55 |
The first seven buttons are standardized to left/middle/right, scroll-up/ |
56 |
down/left/right. Both mtouch and synaptics default 1-3 finger taps to |
57 |
the first three buttons, normally left/right/middle mouse buttons. They |
58 |
also map two-finger-swipes to scroll events in the appropriate direction, |
59 |
up/down/left/right, buttons 4/5/6/7. Beyond button 7, however, is not |
60 |
standardized. |
61 |
|
62 |
Mtrack, however, lets you configure three-finger-swipe up/down/left/right |
63 |
(mapped to four "buttons"), four-finger-swipe up/down/left/right (four |
64 |
more), two-finger pinch-in/out and rotate-left/right (four more), and |
65 |
finally, 4-finger-tap (a final one more) for a total of 20 "buttons", |
66 |
with 7 having standardized mapping and 13 not standardized. |
67 |
|
68 |
Because mtrack maps these gestures to unstandardized X button events, |
69 |
apps such as firefox that normally recognize gestures such as pinch |
70 |
(which it would use for zoom) won't directly recognize them here, since |
71 |
there's no standard or direct button to gesture mapping beyond the first |
72 |
7 buttons. |
73 |
|
74 |
So you have to run another app to handle button event to actual action. |
75 |
I ended up using an app called sxhkd, simple X hotkey daemon, for that. |
76 |
This is a very powerful app that lets you map X keyboard and mouse events |
77 |
to various actions, so in addition to the mouse events we're talking |
78 |
here, people with keyboards with "extra" keys can configure it to watch |
79 |
for those events and trigger various actions, too. |
80 |
|
81 |
In my sxhkd config I break down the nonstandard 13 button events into |
82 |
three groups based on whether I want the actions they are to perform to |
83 |
map globally, be app-specific, or global idea but applied per app. |
84 |
|
85 |
The globally mapped actions are no problem. I simply use another app |
86 |
(xdotool) to perform the specific action, regardless of what window is |
87 |
actually active. |
88 |
|
89 |
The app-specific actions are somewhat more of a problem. What I ended up |
90 |
doing is using a scripted setup that uses xdotool to get the active |
91 |
window, and another app, xprop, to get selected properties of that window |
92 |
(title, window-class, window-role), and match them against a preconfigured |
93 |
set of properties that I know identifies that window. The script is |
94 |
named "winactiveis" and takes a key into the match table as a parameter. |
95 |
It returns shell true or shell false depending on whether the active |
96 |
window matches the configured values based on the key I fed the script. |
97 |
|
98 |
I setup the swipe4 events along with pinch and rotate, and tap4, as |
99 |
global, either full global (don't care the active window) or global idea, |
100 |
applied per app. The swipe3 events are app-specific. |
101 |
|
102 |
So for example, swipe4left/right equate to buttons 14 and 15, and their |
103 |
sxkd config, globally applied, is: |
104 |
|
105 |
# 14,15: swipe4left/right: window-close/desktop-up |
106 |
button14 |
107 |
wmctrl -c :ACTIVE: |
108 |
button15 |
109 |
xdotool key super+F12 |
110 |
|
111 |
|
112 |
(wmctrl is another app, window-manager control. -c tells it to close the |
113 |
given window, and :ACTIVE: points it at the active window. So four- |
114 |
finger-swipe-left closes the active window. xdotool key uses the xtest |
115 |
extension to simulate the named keys. In this case, super-F12 aka win- |
116 |
F12, is the global keyboard shortcut configured in kwin to switch |
117 |
desktops. So four-finger-swipe-right switches to the next desktop.) |
118 |
|
119 |
Here's the sxkd config for two-finger-rotate-left/right, a global idea, |
120 |
applied per app, to apps that let you rotate an image, in this case only |
121 |
gwenview, since that's all I've configured for it so far: |
122 |
|
123 |
# 18,19: rotate: app-context |
124 |
button18 |
125 |
winactiveis gwenview && xdotool key ctrl+l |
126 |
button19 |
127 |
winactiveis gwenview && xdotool key ctrl+r |
128 |
|
129 |
(You see the winactiveis shell script, passed gwenview. If it returns |
130 |
true, gwenview's main window is active, and the xdotool action will be |
131 |
triggered, in this kays, ctrl-l or ctrl-r, which in gwenview is |
132 |
configured to rotate the image left or right.) |
133 |
|
134 |
And here's a more complex multi-app-specific config for three-finger- |
135 |
swipe-up/down. These events trigger app specific actions, something |
136 |
different for each app it has been configured for. |
137 |
|
138 |
# 8,9: swipe3up/down: app-specific |
139 |
# gwenview: start-page/up |
140 |
# firefox: zoom out/in |
141 |
# orion: (cancel)/"gl n" (*100) |
142 |
button8 |
143 |
winactiveis gwenview && xdotool key super+Return ; \ |
144 |
winactiveis firefox && xdotool key ctrl+minus ; \ |
145 |
winactiveis orion && killall xdotool |
146 |
button9 |
147 |
winactiveis gwenview && xdotool key Escape ; \ |
148 |
winactiveis firefox && xdotool key ctrl+plus ; \ |
149 |
winactiveis orion && xdotool type --delay 1333 "gl ngl ngl ngl |
150 |
ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl |
151 |
ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl |
152 |
ngl ngl ngl ngl ngl ngl ngl ngl ngl ngl n" |
153 |
|
154 |
(Again, winactiveis matches the active window. If it's gwenview it does |
155 |
one thing, firefox does something else, and orion, an old DOS based game |
156 |
I run in DOSBox, so it's actually dosbox I'm testing for, does something |
157 |
else again. |
158 |
|
159 |
For gwenview, swipe3up triggers super-Return, which tells gwenview to go |
160 |
to the start page, while swipe3down triggers Escape, which goes a level |
161 |
up in the tree, if it's displaying an image, it returns to directory |
162 |
view, if it's a directory, it goes a level up in the dir tree, etc. |
163 |
|
164 |
For firefox, swipe3up triggers ctrl-minus, while swipe3down triggers ctrl- |
165 |
plus, which zoom firefox out and in, respectively. |
166 |
|
167 |
For orion, swipe3down types a series of keys repeatedly, in ordered to |
168 |
load a saved game and advance one turn, trying to trigger something with |
169 |
a small chance of happening. Once it does or if something else triggers |
170 |
instead, I abort the key repeat using the opposite gesture, swipe3up, |
171 |
killing the xdotool invocation doing the repeat.) |
172 |
|
173 |
.... |
174 |
|
175 |
So bottom line, multitouch and gestures work well, particularly with the |
176 |
xf86-input-mtrack driver, which recognizes upto 20 gestures and |
177 |
translates them into button events. That's extremely flexible, but |
178 |
beyond the 7 standard buttons (1/2/3 and scroll vert/horiz), actually |
179 |
mapping the buttons to specific actions tends to be rather complex and |
180 |
require a bunch of helper apps and scripting. Flexible, you can trigger |
181 |
literally any action you want, per-app or globally, but rather complex to |
182 |
setup, with full functionality basically out of reach for users who don't |
183 |
know how to script it themselves and who don't have someone to do it for |
184 |
them. |
185 |
|
186 |
.... |
187 |
|
188 |
I wouldn't anticipate any specific issues with onscreen keyboards or |
189 |
multi-touch enabled apps, either. |
190 |
|
191 |
Based on my netbook experience, however, I would be a bit worried about |
192 |
app display on low resolution screens, say under 1024 px wide (in |
193 |
whichever mode, landscape or portrait, you run), if the app isn't well |
194 |
designed for it, and about trying to maintain reasonable app display area |
195 |
when the screen is shared with the onscreen keyboard. |
196 |
|
197 |
Additionally, switching landscape/portrait may well require complex |
198 |
scripted solutions of the type I used above for gesture to action |
199 |
mapping, tho I'm not familiar enough with the territory to say for sure. |
200 |
If you're willing to hack your own solutions using existing tools as I |
201 |
did above, I've little doubt you'll be fine. If not, you're likely to |
202 |
run into problems except when using pre-rolled solutions like plasma- |
203 |
active, which will considerably limit your app selection. Of course, |
204 |
android or the like would be the easy way around that, but if you were |
205 |
satisfied with that, you wouldn't have posted the question, right? =:^) |
206 |
|
207 |
My primary concern, however, is lack of data on specific hardware kernel |
208 |
drivers. The kernel drivers for my t650 touchpad, for instance, simply |
209 |
weren't complete when I first got the device, and I was looking at all |
210 |
sorts of potential workarounds, but I regularly run mainline Linus pre- |
211 |
release git kernels, and I updated one kernels one day and suddenly it |
212 |
was registering differently and more completely with the kernel. After |
213 |
that, I could even use evdev with it, tho as I said, evdev functionality |
214 |
is extremely limited, and both synaptic and mtrack were basically full- |
215 |
functionality without further configuring, except tweaking of the |
216 |
details. I'd anticipate similar issues for touchscreen hardware, etc. |
217 |
|
218 |
Tho if it has USB support you can always plugin a standard keyboard and |
219 |
trackpad and use that until you get the builtin hardware up and running. |
220 |
|
221 |
And I should also mention, don't expect to work with keyboard or mouse in |
222 |
CLI, unless you have something plugged in. Touchscreen and onscreen- |
223 |
keyboard, effectively only in X. (My touchpad works with gpm to the |
224 |
extent that the pointer moves, but without hardware buttons I can't |
225 |
really click anything, which means no onscreen keyboard at the CLI |
226 |
either, even if there's some ncurses or whatever based solution that |
227 |
presumably would work with gpm, and I'm not aware of any, tho perhaps |
228 |
I've just missed it.) |
229 |
|
230 |
-- |
231 |
Duncan - List replies preferred. No HTML msgs. |
232 |
"Every nonfree program has a lord, a master -- |
233 |
and if you use the program, he is your master." Richard Stallman |