AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Disable auto-repeat for all function keys (F1 .. F12)

 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
Guest






PostPosted: Mon Mar 01, 2010 1:20 pm    Post subject: Disable auto-repeat for all function keys (F1 .. F12) Reply with quote

Hello,

I want to disable auto-repeat for all function keys (F1 .. F12). If there is one of the modifier keys (Shift, Ctrl, Alt) additionally pressed, this modifier must be passed to the application, too.
As you can see, the code is quite long only for key F1, and, well, it's easy to duplicate this code eleven times.
But I was not successful to create a loop to solve this problem. Any help would be appreciated. Thanks, Stefan

Code:
$F1::
sendevent {F1 down}
keywait F1
sendevent {F1 up}
return

+$F1::
sendevent +{F1 down}
keywait F1
sendevent +{F1 up}
return

!$F1::
sendevent !{F1 down}
keywait F1
sendevent !{F1 up}
return

^$F1::
sendevent ^{F1 down}
keywait F1
sendevent ^{F1 up}
return
Back to top
tonne



Joined: 06 Jun 2006
Posts: 1651
Location: Denmark

PostPosted: Mon Mar 01, 2010 2:13 pm    Post subject: Reply with quote

Code:
; create dynamic hotkey for f1..f3
Loop 3
  Hotkey $*f%a_index%, f_all
Return

f_all:
  ; only send key (and show tooltip) if prior key wasn't the same as this key
  if (A_ThisHotkey != A_PriorHotkey)
  {
    Send % "{" substr(A_ThisHotkey,3) "}"
    ToolTip %A_Now% %A_ThisHotkey%
  }
Return

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group