使用autohotkey切换按键上的mousetrail [英] Toggling mousetrail on keypress with autohotkey

查看:112
本文介绍了使用autohotkey切换按键上的mousetrail的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用自动热键脚本通过按键(Windows键+ q)打开和关闭鼠标轨迹,但是无法正常工作.

I'm trying to toggle mouse trails on and off with a keypress (windows key + q) using an autohotkey script, but can't get it working.

这是我的代码-

#q::
if DllCall("SystemParametersInfo", 94) < 2
{
DllCall("SystemParametersInfo", UInt, 0x005E, UInt, 0, UInt, 9, UInt, 0)
}else {
DllCall("SystemParametersInfo", UInt, 0x005E, UInt, 0, UInt, 0, UInt, 0)
}
return

您能提供帮助吗?

推荐答案

首先使用SPI_ GET MOUSETRAILS通过引用( intP )将值读取到变量中,然后设置使用SPI_ SET MOUSETRAILS创建新值:

First read the value using SPI_GETMOUSETRAILS into a variable by reference (intP) then set the new value using SPI_SETMOUSETRAILS:

#q::
    DllCall("SystemParametersInfo", int,SPI_GETMOUSETRAILS:=0x5E, int,0, intP,length, int,0)
    length := length > 1 ? 0 : 9
    DllCall("SystemParametersInfo", int,SPI_SETMOUSETRAILS:=0x5D, int,length, int,0, int,0)
    return

这篇关于使用autohotkey切换按键上的mousetrail的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆