Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

RapidHotkey()


  • Please log in to reply
101 replies to this topic
HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

I created a bug report but not sure if this can/will be fixed.

To work around simply add Hotkey ^a::Send ^a outside of #IfWinNotActive ...



blushedvermin
  • Members
  • 2 posts
  • Last active: Jan 10 2015 11:37 AM
  • Joined: 10 Jan 2015

Hello i've got a question , im still new to all of this so i was wondering if someone could make me a script so i can learn it from there , its a very easy one tho ( i think ) 

i'm trying to put an Infinite "W" key spam / rapidhotkey  with 10 Delay or less but i want the "W" key to stop if another key is pressed

Is that possible and could someone maybe post it in here or send me a private message so i can save it in my notepad and then continue on my own from there.

Thanks in advance



Psychofergo
  • Members
  • 23 posts
  • Last active: Jan 10 2015 04:41 PM
  • Joined: 09 Dec 2013

This is pretty cool. I have been using scripts like this for a while now for shortcuts.

This sends the {end} key when you double-tap the shift key. Gives you 500ms in which to detect a second shift key. I use this all the time.

Shift::
	If A_PriorHotkey = Shift
	{
		If A_TimeSincePriorHotkey < 500
		{
			SendInput {end}
			Return
		}
	}
	keywait, +
	suspend
	suspend
Return

This code takes different number of key presses within a certain time, then does whatever you want. This particular example changes the tab on a Gui, and enters information into a search box. This is currently used in a pathology lab report typing department. 

 

F4::
if F4Triger > 0 ; Timer already started, so log the keypress instead.
{
    F4Triger += 1
    return
}

F4Triger = 1
SetTimer, KeyF4, 400 
return

KeyF4:
SetTimer, KeyF4, off
if F4Triger = 1 
{
    GuiControl, Choose, SysTabControl321, 1
	Gosub, CodeLookUp
	;MsgBox, once  
}
else if F4Triger = 2 
{
	GuiControl, Choose, SysTabControl321, 3
	GoSub, DicLookUp
	;MsgBox, twice 
}
else if F4Triger > 2
{
    MsgBox, 3 detected 1=code search 2=MedDic search `n `t try again
}
;Reset for next detection
F4Triger = 0
return


Psychofergo
  • Members
  • 23 posts
  • Last active: Jan 10 2015 04:41 PM
  • Joined: 09 Dec 2013

Hello i've got a question , im still new to all of this so i was wondering if someone could make me a script so i can learn it from there , its a very easy one tho ( i think ) 

i'm trying to put an Infinite "W" key spam / rapidhotkey  with 10 Delay or less but i want the "W" key to stop if another key is pressed

Is that possible and could someone maybe post it in here or send me a private message so i can save it in my notepad and then continue on my own from there.

Thanks in advance

 

hey, you could try using a 2 threads in a loop. Here is an example i was playing with when making some remote access stuff. Making it generic to not break 'nasty stuff' rules....

 

#MaxThreadsperHotkey 2

F8::
toggle := !toggle
Loop
{
	if toggle
	{	
	        ;your repeating stuff goes here, and keeps going till you hit the hotkey again.
	}
	else
		break
}
Return

for anykey stuff, check this stuff  http://www.autohotke...y-key-possible/

hope that helps :)



blushedvermin
  • Members
  • 2 posts
  • Last active: Jan 10 2015 11:37 AM
  • Joined: 10 Jan 2015

hey, you could try using a 2 threads in a loop. Here is an example i was playing with when making some remote access stuff. Making it generic to not break 'nasty stuff' rules....

 

#MaxThreadsperHotkey 2

F8::
toggle := !toggle
Loop
{
	if toggle
	{	
	        ;your repeating stuff goes here, and keeps going till you hit the hotkey again.
	}
	else
		break
}
Return

for anykey stuff, check this stuff  http://www.autohotke...y-key-possible/

hope that helps :)

 

Thank you for the fast response and the tips and showing me a script , i will try this with the key "W" because im trying to make it spam "W" like key up and key down the same movements when you Press "W" and release it and press it again so it repeats the up and down if you understand what i mean by this im still new to the whole scripting.



Baal
  • Members
  • 81 posts
  • Last active: Apr 15 2016 04:38 PM
  • Joined: 04 Jun 2014

Hi, thanks for this great script. I been wondering is it possible to make button double click work for all programs same, when single click works different? For example:

Xbutton1 double click sends !{Tab} 

#ifwinactivate, mozilla 
xbutton1::send, t 

#ifwinactivate, word 
xbutton1::send, r 

#ifwinactivate, excel 
xbutton1::send, g 


HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

Try this:

xbutton1::
  If A_TimeSincePriorHotkey<500
  {
    SetTimer,Send,Off
    Send !{Tab}
  } else
    SetTimer,Send,-500
Return
Send:
  If WinActive("mozilla")
    Send t
  else If WinActive("word")
    Send r
  else If WinActive("excel")
    Send g
Return


Baal
  • Members
  • 81 posts
  • Last active: Apr 15 2016 04:38 PM
  • Joined: 04 Jun 2014
&nbsp;


Try this:

xbutton1::  If A_TimeSincePriorHotkey&lt;500  {    SetTimer,Send,Off    Send !{Tab}  } else    SetTimer,Send,-500ReturnSend:  If WinActive("mozilla")    Send t  else If WinActive("word")    Send r  else If WinActive("excel")    Send gReturn
&nbsp;

Thanks for help! But this causes button to activate action very slowly. Is there way to make it faster?

HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

Change SetTimer,Send,-500 to get desired speed.



dsewq1LYJ
  • Members
  • 203 posts
  • Last active: May 12 2018 05:04 AM
  • Joined: 16 Jul 2014

Excuse me.

 

How to bind a RapidHotkey for Wheelup & WheelDown ?



HotKeyIt
  • Moderators
  • 7439 posts
  • Last active: Jun 22 2016 09:14 PM
  • Joined: 18 Jun 2008

Same way but I am not sure if it will work properly, what happens here:

$Wheelup::RapidHotkey("1""2""3",2)


dsewq1LYJ
  • Members
  • 203 posts
  • Last active: May 12 2018 05:04 AM
  • Joined: 16 Jul 2014

 

Same way but I am not sure if it will work properly, what happens here:

$Wheelup::RapidHotkey("1""2""3",2)

No.

It didn't work.

 

Can you make a implement for WheelUp & Down Please ~

That would be so cool !