Not consume keys Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
nakdbasd2

Not consume keys

30 May 2017, 19:15

I have a key with a problem. F7 when pressed triggers F7 and F8...

i tried this:

#InstallKeybdHook
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#InputLevel 1

F7::
SendLevel 1
Send, F7
Return

results: F7 + F8

but is keeping triggering F7 and F8... if was a normal key "g" i could do this:

F7::
SendLevel 1
Send, F7{Backspace}
Return

results: F7

but a function key is not controllable...how can i do???
nakdbasd
Posts: 3
Joined: 30 May 2017, 18:55

Re: Not consume keys

30 May 2017, 20:08

donovv...does not work but i found the solution:

F8::
SendLevel 1
Send, %nullvar%
Return

F7::
SendLevel 1
Send, F7
Return


results: F7

;)
nakdbasd
Posts: 3
Joined: 30 May 2017, 18:55

Re: Not consume keys

30 May 2017, 20:16

sorry i have to ask again cause i found the same problem with other key.
when pressed F6 triggers F6 and F9...
i can not use a nullvar for F9 cause i use this key.

how can i circumvent this time?
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Not consume keys  Topic is solved

30 May 2017, 20:48

Try this:

Code: Select all

$F9::
If (A_PriorKey="F6")
    return
else
   Send {F9}
return
Or more succinctly written:

Code: Select all

$F9::
If !(A_PriorKey="F6")
   Send {F9}
return

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Bing [Bot], DecimalTurn, Google [Bot], macromint, peter_ahk and 344 guests