有用键盘映射 kanata 工具的不?求教鼠标映射

2 天前
 molezznet

最近看到 rust 工具 kanata 推荐,感觉有点意思,方便特殊输入 https://github.com/jtroo/kanata?tab=readme-ov-file

尝试了下键盘和文字宏都成功了,但是鼠标没成功,想把侧键点击映射成鼠标中键 试了 mftp: tap forward mouse button ,mbtp: tap bacward mouse button ,mbck ,mfwd 都不行。

(defcfg
  #|
  This configuration will process all keys pressed inside of kanata, even if
  they are not mapped in defsrc. This is so that certain actions can activate
  at the right time for certain input sequences. By default, unmapped keys are
  not processed through kanata due to a Windows issue related to AltGr. If you
  use AltGr in your keyboard, you will likely want to follow the simple.kbd
  file while unmapping lctl and ralt from defsrc.
  |#
  process-unmapped-keys yes
)

(defsrc
  caps grv     q    w  e	[	]	Backspace
                     a   s    d
  lsft 									.	rsft                       
                                        ralt  apps 	rctl
  🖰4  
)

(deflayer default
  @cap   (unicode "`")        _     _   _	_	_	_
                       _    _    _
  _  											_	  _
                                             @ralt  VolumeDown   VolumeUp
  🖰3 
)

(deflayer ralt
  _    (unicode "`")    home   up  end		VolumeDown	VolumeUp	Delete
              left down rght
  _   									(unicode ">")	  _
                                          _		_   _
  _ 
)

(defalias
  cap (tap-hold-press 200 200 (unicode ">")  (layer-toggle ralt))
  ralt (tap-hold-press 200 200 grv (layer-toggle ralt))
)
469 次点击
所在节点    程序员
4 条回复
john296
2 天前
known issues:
Mouse inputs cannot be used for processing or remapping.
xujinkai
2 天前
如果是 Windows 下的话,可以试下我做的 onequick ,支持鼠标键盘任意按键以及热键的映射
https://onequick.org/
molezznet
2 天前
@john296 好吧, 光顾着文档说明了, 没注意原来还没支持
molezznet
2 天前
@xujinkai 嗯 不错。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1094258

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX