topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Thursday March 28, 2024, 3:09 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: IDEA: delay F1 key  (Read 14126 times)

pseudolus

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 9
    • View Profile
    • In My Own Way
    • Donate to Member
IDEA: delay F1 key
« on: August 15, 2005, 02:21 PM »
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.
"Learn the rules so you know how to break them properly."
 The Dalai Lama
« Last Edit: April 05, 2006, 10:32 AM by brotherS »

iorange28880

  • Charter Member
  • Joined in 2005
  • ***
  • default avatar
  • Posts: 13
    • View Profile
    • Donate to Member
Re: request : delay F1 key
« Reply #1 on: August 15, 2005, 03:54 PM »
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

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: request : delay F1 key
« Reply #2 on: August 16, 2005, 04:04 AM »
 :) 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

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 9
    • View Profile
    • In My Own Way
    • Donate to Member
Re: request : delay F1 key
« Reply #3 on: August 16, 2005, 05:15 AM »
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:
"Learn the rules so you know how to break them properly."
 The Dalai Lama

noth(a)nk.you

  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 78
  • More than meets the eye.
    • View Profile
    • Donate to Member
Re: request : delay F1 key
« Reply #4 on: April 05, 2006, 10:29 AM »
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.

skrommel

  • Fastest code in the west
  • Developer
  • Joined in 2005
  • ***
  • Posts: 933
    • View Profile
    • 1 Hour Software by skrommel
    • Donate to Member
Re: IDEA: delay F1 key
« Reply #5 on: April 10, 2006, 09:14 AM »
 :) This option has been added to CAPshift.

Check out https://www.donationcoder.com/forum/index.php?topic=476.0 or my home page below.

Skrommel

bobsobol

  • Participant
  • Joined in 2006
  • *
  • default avatar
  • Posts: 2
    • View Profile
    • Donate to Member
Re: IDEA: delay F1 key
« Reply #6 on: October 07, 2006, 10:32 AM »
I have to say I have a habbit of going to press the Escape or Function Lock key, and my finger slips off and on to the recessed User button so that the flipping PC hybernates. :(

The user key in Windows can tell the system to Sleep, Hybernate or Shutdown. Why can't it pop up a shutdown dialogue I could choose from these three or cancel if I hit it by mistake. Actually I do intentionally use it when the screen is of as this machine is also a Print Server on the home network so a default on a 5/10 second countdown would work too.

The recess on my logitec keyboard I'm sure is intended to stop me hitting it by accident, but when I slip a regular key would stop a side on press, so the recessed key is just worse.

I know these extended keys (Function Lock & User) can be a pain to program, which is why I've never done anything to fix it. If anyone knows a way to break out their extended functionality I'd be greatful. The Function Lock feature is a pain too as the system starts or restores with the function keys in extended mode and requires me to press it before I get access to F1-F12 again, and TBH, I never use them for anything else.

A program for Function Lock On/Off at startup like the numerous Caps/Scroll/NumLoc programs would be fab, but I don't think it's possible because the state of FLock is held internally in the keyboard and not transmitted to the PC... I think. Either that or I'm not using low enough level APIs to catch it.
« Last Edit: October 07, 2006, 10:35 AM by bobsobol »

JavaJones

  • Review 2.0 Designer
  • Charter Member
  • Joined in 2005
  • ***
  • Posts: 2,739
    • View Profile
    • Donate to Member
Re: IDEA: delay F1 key
« Reply #7 on: October 07, 2006, 03:48 PM »
This thread has some ideas for f-lock fixing: https://www.donation...dex.php?topic=5181.0

- Oshyan