求助:每隔三秒重新设置重映射如何实现?

遇到了问题?请先进行搜索(中文和英文),然后在此提问

Moderators: arcticir, tmplinshi

carloskaine
Posts: 6
Joined: 24 Mar 2018, 06:17

求助:每隔三秒重新设置重映射如何实现?

07 Jun 2018, 01:28

各位大神,我想实现这么一个功能:
从按下space起,每隔三秒,将space轮流重映射为3和4
只要space按下,每隔三秒,发送一次shift+click
请问怎么实现啊

这是我的代码,似乎有无数问题
$space:: {
If v_Enable
func(3)
else
func(4)
}
return

func(key) {
space::key
v_Enable:=!v_Enable
if getkeystate("space", "p") {
send, {shift down}
click
send, {shift up}
}
sleep 3000
return
}
Hatsuko
Posts: 15
Joined: 09 May 2018, 16:56

Re: 求助:每隔三秒重新设置重映射如何实现?

19 Dec 2018, 00:44

carloskaine wrote:
07 Jun 2018, 01:28
从按下space起,每隔三秒,将space轮流重映射为3和4
只要space按下,每隔三秒,发送一次shift+click
这两行是要同时实现吗?如果是的话,不太明白确切什么意思。space 每隔三秒轮流映射成 3 和 4,而且每隔三秒发送 shift+click,所以是希望合并起来,每隔三秒轮流发送 shift+click+3/shift+click+4 吗?总之试着写了一下。

Code: Select all

Space::
	SendShiftClick3Or4()
	SetTimer, SendShiftClick3Or4, 3000
	KeyWait, Space  ; Waits for Space to be released
	SetTimer, SendShiftClick3Or4, Off
	Return

SendShiftClick3Or4() {
	static num := 3
	SendInput, {Shift down}{Click}%num%{Shift up}
	If (num == 3) {
		num := 4
	}
	Else {
		num := 3
	}
}

Return to “请求帮助”

Who is online

Users browsing this forum: No registered users and 5 guests