AutoHotKey可以拦截鼠标单击吗?

时间:2019-03-06 15:48:47

标签: autohotkey

我使用AutoHotKey重新映射一些键,这非常有用。示例:

private void MenuItem_Click(object sender, RoutedEventArgs e)
{
    MenuItem mi = (MenuItem)sender;
    ContextMenu cm = mi.Parent as ContextMenu;
    if (cm != null)
    {
        FrameworkElement fe = cm.PlacementTarget as FrameworkElement;
        if (fe != null)
        {
            object dataItem = fe.DataContext;
            //...
        }
    }
}

这将拦截!t:: Send, ^t return 键并发送Alt-t

我想知道是否有办法拦截Ctrl-t并发送Alt-LeftMouseClick吗?

2 个答案:

答案 0 :(得分:2)

这会将ALT + LeftMouseClick映射到Ctrl + LeftMouseClick

!lbutton::send ^{click}

答案 1 :(得分:0)

结果证明,我可以这样做:

!LButton::
        Send, {Control down}
        MouseClick
        Send, {Control up}
return