Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[trime-v3.2.16-0-g5738657b-release][四叶草九宫格][在编辑界面有个搜索按钮,我想把它换成别的,可以做到吗?] #126

Open
yhm-amber opened this issue Jun 18, 2024 · 3 comments

Comments

@yhm-amber
Copy link

yhm-amber commented Jun 18, 2024

误触这个按钮时的后果实在过于恶毒,我已经有数次因为误触这个按钮而失去了我在浏览器编辑了半天的文本。

复现步骤

  • 点击【编辑】按钮后来到编辑界面
  • 该界面最右边中间的按钮是搜索按钮
  • 误触该按钮会进入百度搜索,我不用百度作为搜索引擎,也不希望在此时搜索。
  • 当误触搜索时,搜索页面会被强行打开,此时后退也不会退回之前页面而是关闭浏览器,这可能会让先前编辑文本的页面失去已经填充的内容。

正确的结果

这个按钮可以被改为别的。

使用设备情况(请完整填写如下信息):

  • 操作系统: 安卓
  • Rime软件名称和版本:同文 3.2.16
  • 输入方案:四叶草九宫格
  • 使用皮肤:同文增强版
@SivanLaai
Copy link
Owner

可以,你要改trime.yaml这个文件

@yhm-amber
Copy link
Author

yhm-amber commented Jun 27, 2024

可以,你要改trime.yaml这个文件

感谢。


不过我遇到一个问题,当我不分大小写地搜索 baidu 时我只找到了这样一部分:

......
  Homepage: {label: 同文主頁, command: run, option: "https://github.com/osfans/trime"} #查看網頁: run 網址
  CommitHomepage: {label: 同文網址, commit: https://github.com/osfans/trime} #直接上屏
  Wiki: {label: 維基, command: run, option: "https://zh.wikipedia.org/wiki/%s"} #搜索網頁: %s或者%1$s爲當前字符
  Google: {label: 谷歌, command: run, option: "https://www.google.com/search?q=%s"} #搜索網頁: %s或者%1$s爲當前字符
  MoeDict: {label: 萌典, command: run, option: "https://www.moedict.tw/%3$s"} #搜索網頁: %3$s爲光標前字符
  Baidu: {label: 百度搜索, command: run, option: "https://www.baidu.com/s?wd=%4$s"} #搜索網頁: %4s爲光標前所有字符
  Zdic: {label: 漢典, command: run, option: "http://www.zdic.net/sousuo/?q=%1$s"} #搜索網頁: %s或者%1$s爲當前字符
  Zdic2: {label: 漢典, command: run, option: "http://www.zdic.net/sousuo/?q=%2$s"} #搜索網頁: %2$s爲當前輸入的編碼
  WebSearch: {label: 搜索網頁, command: web_search, option: "%4$s"} #搜索,其他view、dial、edit、search等intent,參考安卓的intent文檔:https://developer.android.com/reference/android/content/Intent.html
  Search: {label: 搜索, command: search, option: "%1$s"} #搜索短信、字典等
  Share: {label: 分享, command: send, option: "%s"} #分享指定文本: %s或者%1$s爲當前字符
  Deploy: {label: 部署, command: broadcast, option: "com.osfans.trime.deploy"}
  Sync: {label: 同步, command: broadcast, option: "com.osfans.trime.sync"}
  RepeatCommit: { label: 重复,  command: commit, option: "%1$s" } #重复输入刚上屏的内容
......

看起来我似乎能够选择我用什么搜索,但我并没有找到这个配置。不应该是另外一个地方被填写了 Baidu 这个标签才使得那个按钮是百度搜索吗?

另外,我尝试删除这行,但程序崩溃,然后我的这个 yml 文件就回到了原来的样子(不作改动它也照样会在部署的时候崩溃但因为崩溃完了也能用我就没管它)。


哦,我找到了,应该是在 同文风增强版.trime.yaml 文件里,最后地部分:

......
  ChineseDate: {label: 农历, send: function, command: date, option: "zh_CN@calendar=chinese"} #农历等日期(>=Android 7.0):date 语言@calendar=历法 格式。具体參見https://developer.android.com/reference/android/icu/util/Calendar.html
  Time: {label: "™", send: function, command: date, option: " HH:mm:ss "}
  Flypy: {label: "键盘", send: Menu }
  Handian: {label: 金山, functional: false, send: function, command: run, option: " http://www.iciba.com/word?w=%3$s"}
  Xiaohe: {label: 小鹤主页, functional: false, send: function, command: run, option: "http://www.flypy.com"}
  Baidu: {label: 百度, functional: false, send: function, command: run, option: "https://www.baidu.com/s?wd=%3$s"}
  Tieba: {label: 贴吧, functional: false, send: function, command: run, option: "com.baidu.tieba"}
  TrimeCmp: {label: 同文组件, send: function, command: run, option: "com.osfans.trime/ .Pref"} #运行程序指定组件:run包名/组件名
  date_time: {label: time, send: function, command: date, option: "yyyy-MM-dd  HH:mm:ss"}
  HDSS: {label: 金山, functional: false, send: function, command: run, option: " http://www.iciba.com/word?w=%3$s"} # 搜索网页: %3$s为光标前一个字符或选中字符或未上屏首选词条
  BDHY: {label: Ⓓ, send: function, command: run, option: "https://hanyu.baidu.com/s?wd=%3$s"}
  XHIX: {label: 鹤形, send: function, command: run, option: "http://www.xhup.club/?search_word=%4$s"}
  BDSS: {label: 🔍️, send: function, command: run, option: "https://www.baidu.com/s?wd=%4$s"} # 搜索网页:%4$s为光标前所有字符或选中字符或未上屏首选词条
  LLQ: {label: Ⓛ, send: function, command: web_search, option: "%4$s"} # 直达光标前http开头的网址或搜索光标前内容
......

那个放大镜就是我要找的那个令人困扰地按钮啦。

@yhm-amber
Copy link
Author

yhm-amber commented Jun 27, 2024

同文风增强版.trime.yaml 中我把相应行的网址做了修改:

....
  BDSS: {label: 🔍️, send: function, command: run, option: "https://duckduckgo.com/?ia=chat&q=%4$s"} # 搜索网页:%4$s为光标前所有字符或选中字符或未上屏首选词条
....

我觉得这肯定是一种不规范的 hack ,因为前面的标签还是 BDSS 即“百度搜索”的含义,我怕程序中对这部分是硬编码的,因此没对它做改动。

现在这个按钮会自动跳转到鸭鸭去的 AI 聊天页面,我觉得这很不错。

我不知道这里的问题 —— 如:并没有一个比较明确的位置来编辑这个放大镜按钮的点击效果;以及:我不知道要怎么改动这个按钮的功能好让它不是触发搜索而可以是别的什么 —— 是否在本软件的修复目标内,因此我先不关闭这个 issue 。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants