Lui*_*lez 24 unity google-chrome touchscreen
我有一台带 Ubuntu 14.04 的带触摸屏的戴尔 14R。当我通过触摸板或 Super+ 组合单击启动器启动 Google Chrome 时,Chrome 中的触摸支持不起作用。当我触摸某个元素时,它只会获得焦点,但不会激活该元素(按钮、字段等)。触摸手势不起作用。另一方面,如果我通过触摸启动器按钮启动 Chrome,触摸滚动在 Chrome 中工作,即使向左轻弹也会回到上一页等。这对我来说没有意义,但总是这样,即使跨重启。任何人都可以确认这一点吗?关于如何修复的任何想法?
ale*_*lex 24
可以使用 Chrome 的--touch-devices
命令行参数为我解决这个问题。
在控制台中确定 X 的输入设备 ID
xinput list
Run Code Online (Sandbox Code Playgroud)
导致
google-chrome --touch-devices=10
Run Code Online (Sandbox Code Playgroud)
在我的系统上。
要使 Chrome 始终使用此 CLI 标志,请参阅: 如何为 Google Chrome 设置 CLI 标志?
更新的答案:
编辑~/.profile
并将以下内容添加到文件末尾:
export CHROMIUM_USER_FLAGS="--touch-devices=`echo $(xinput list | grep 'Virtual core pointer' | awk 'match(\$0, /id=/){print substr($0, RSTART+3, RLENGTH-1)}')` --touch-events=enabled --enable-pinch"
Run Code Online (Sandbox Code Playgroud)注销然后重新登录。
正常启动谷歌浏览器
提示:您可能需要将上面命令中的“Virtual core pointer”字符串更改为上面命令中“主指针”触摸屏输入设备的名称。只需使用xinput
命令来查找您的设备的名称。
注意:我在 Ubuntu 15.04 上使用/usr/bin/google-chrome-stable
旧答案:
我有 Ubuntu 14.14。这对我有用:
制作一个 shell 脚本来启动 Google Chrome 浏览器,名为start-chrome.sh
.
我把我的: /usr/local/bin/start-chrome.sh
将以下内容添加到文件中:
#!/bin/bash
/usr/bin/google-chrome-stable --touch-devices=$(xinput list | grep Touchscreen | awk 'match(\$0, /id=/){print substr($0, RSTART+3, RLENGTH)}') --touch-events=enabled --enable-pinch
Run Code Online (Sandbox Code Playgroud)
基本上,我使用xinput list
命令和greping“触摸屏”并找到它对应的ID。您可能需要在上面的命令中将“Touchscreen”更改为您的触摸屏输入设备的名称。
编辑/usr/share/applications/google-chrome.desktop
。查找所有出现的Exec=google-chrome-stable
并将其替换为Exec=start-chrome.sh
注意:我相信此解决方案将有效,直到您更新 Google Chrome(通过apt-get upgrade
)并且google-chrome.desktop
文件被覆盖。您需要按照上面的步骤 2 进行修复。
您可以尝试在 Chrome 标志下启用触摸事件:
chrome://flags/#touch-events
并将其设置为启用来源:
归档时间: |
|
查看次数: |
26146 次 |
最近记录: |