V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
molezznet
V2EX  ›  程序员

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

  •  
  •   molezznet · 19 天前 · 592 次点击

    最近看到 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))
    )
    
    4 条回复    2024-12-02 14:07:15 +08:00
    john296
        1
    john296  
       19 天前   ❤️ 1
    known issues:
    Mouse inputs cannot be used for processing or remapping.
    xujinkai
        2
    xujinkai  
       19 天前 via Android
    如果是 Windows 下的话,可以试下我做的 onequick ,支持鼠标键盘任意按键以及热键的映射
    https://onequick.org/
    molezznet
        3
    molezznet  
    OP
       19 天前
    @john296 好吧, 光顾着文档说明了, 没注意原来还没支持
    molezznet
        4
    molezznet  
    OP
       19 天前
    @xujinkai 嗯 不错。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2591 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 18ms · UTC 11:03 · PVG 19:03 · LAX 03:03 · JFK 06:03
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.