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

Post a reply


In an effort to prevent automatic submissions, we require that you complete the following challenge.
Smilies
:D :) ;) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :!: :?: :idea: :| :mrgreen: :geek: :ugeek: :arrow: :angel: :clap: :crazy: :eh: :lolno: :problem: :shh: :shifty: :sick: :silent: :think: :thumbup: :thumbdown: :salute: :wave: :wtf: :yawn: :facepalm: :bravo: :dance: :beard: :morebeard: :xmas: :HeHe: :trollface: :cookie: :rainbow: :monkeysee: :monkeysay: :happybday: :headwall: :offtopic: :superhappy: :terms: :beer:
View more smilies

BBCode is ON
[img] is OFF
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

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

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

Post by Hatsuko » 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
	}
}

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

Post by carloskaine » 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
}

Top