Toggling mousetrail on keypress with autohotkey

主宰稳场 提交于 2021-01-29 06:19:20

问题


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.

This is my code-

#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

Are you able to help?


回答1:


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


来源:https://stackoverflow.com/questions/32909204/toggling-mousetrail-on-keypress-with-autohotkey

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!