ATTENTION: You are viewing a page formatted for mobile devices; to view the full web page, click HERE.

DonationCoder.com Software > Unfinished Requests

IDEA: delay F1 key

(1/2) > >>

pseudolus:
Hi all!
I'm a new member, looking for a little help. I tried modifying that delicious snack called "CapShift.ahk" to my own use. My goal was to make the F1 key less touchy. I am constantly hitting hit when I mean to hit 'esc'. I was wondering if I could get AHK to intercept the hit and wait and see if the key was held down for 2 seconds instead of hit-and-released immediately. I want it to function as a proper F1 key, just not be so quick to throw up a help file if I accidently hit it.

Thanks in advance,
Love the site.

iorange28880:
I remapped my F1 to Esc, and I don't miss it. I never use application help, I google (it's always faster), so what's the point of the key? Just to bug me, apparently.

skrommel:
 :) WaitForIt delays the F1 key until it's pressed down for 2 secs.

Download and install AutoHotKey from www.autohotkey.com. Save the script as WaitForIt.ahk and doubleclick to run.

Skrommel



--- ---WaitForIt.ahk
; Delays the F1 key
;Skrommel @2005

$F1::
counter=2000
Loop,10
{
  counter-=200
  ToolTip,Help in %counter% ms
  Sleep,150
  GetKeyState,state,F1,P
  If state=U
  {
    ToolTip,
    Return
  }
}
Send,{F1}
ToolTip,Help
Sleep,1000
ToolTip,
Return

pseudolus:
Thanks, Skrommel! You da man! I will inspect this and see if I can make sense of it. It works great. I was ready to do as suggested above and remap the key. 3 cheers for the snack coder!! :up: :up: :up:

noth(a)nk.you:
Based largely on Skrommel's work above, this is my implementation:


--- ---; Delays the F1 key
$F1::
Loop,20
{
  Sleep,50
  GetKeyState,state,F1,P
  If state=U
  {
    Send,{Esc}
    Return
  }
}
Send,{F1}
Return

The biggest change functionally is that Escape is sent in the case that F1 is not held down for the full duration.

Navigation

[0] Message Index

[#] Next page

Go to full version