xianyukang / MyKeymap

一款基于 AutoHotkey 的键盘映射工具
https://xianyukang.com/MyKeymap.html
GNU General Public License v3.0
787 stars 63 forks source link

完成绑定模式 #113

Closed Ocyss closed 1 year ago

Ocyss commented 1 year ago

使用方法只需要在名称前加上$符号,快捷键绑定内容会自动生成,优先级低于自定义热键

不影响未绑定的快捷键

例子:

  ; $Win
  km5 := KeymapManager.NewKeymap("customHotkeys", "$Win", "")
  km := km5 
  km.Map("#*t", _ => ActivateOrRun("", "shortcuts\Notepad3.lnk"))
  km.Map("#+*", _ => SoundControl())
  km.Map("#*m", _ => ToggleWindowTopMost())
  km.Map("#*q", _ => SmartCloseWindow())
  km.Map("#*s", _ => MaximizeWindow())
  km.RemapKey("#*z", "RWin")
  km.Map("#*1", _ => GoToDesktopNumber(0))
  km.Map("#*2", _ => GoToDesktopNumber(1))
  km.Map("#*3", _ => GoToDesktopNumber(2))
  km.Map("#*4", _ => GoToDesktopNumber(3))
  km.Map("#*tab", _ => TabDesktop())

  ; $Win + Shift
  km18 := KeymapManager.NewKeymap("customHotkeys", "$Win + Shift", "")
  km := km18 
  km.RemapKey("+#*z", "RWin")
  km.Map("+#*1", _ => MoveCurrentWindowToDesktops(0))
  km.Map("+#*2", _ => MoveCurrentWindowToDesktops(1))
  km.Map("+#*3", _ => MoveCurrentWindowToDesktops(2))
  km.Map("+#*4", _ => MoveCurrentWindowToDesktops(3))
  km.Map("+#*left", _ => GoToPrevDesktop())
  km.Map("+#*right", _ => GoToNextDesktop())

  ; 自定义热键
  km1 := KeymapManager.NewKeymap("customHotkeys", "自定义热键", "")
  km := km1 
  km.Map("RWin", _ => SoundControl())