Issue with sending and receiving F13 - F24 Topic is solved

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Issue with sending and receiving F13 - F24

23 Feb 2018, 19:07

Hi,

First off: This is NOT a gaming related question.

I created a script which executes specific commands whenever F13, F14 or F15 get pressed.
(These keys get pressed by external software - either by BOME MIDI Translator Pro or Logitech Gaming Software.)
Everything works perfectly.

However, I can't receive F13 commands which were sent BY AutoHotKey.
I tried this

Code: Select all

;Notepad++
#if WinActive("ahk_class Notepad++")
F12::
Send {F13}
return

F13::
ControlClick, x450 y180, Logitech Gaming Software
SplashImage, C:\Users\USER\Documents\Logitech Gaming Software\Profil-Screenshots\Notepad++-M1.png, x1920 b
return

F14::
ControlClick, x509 y180, Logitech Gaming Software
SplashImage, C:\Users\USER\Documents\Logitech Gaming Software\Profil-Screenshots\Notepad++-M2.png, x1920 b
return

F15::
ControlClick, x556 y180, Logitech Gaming Software
SplashImage, C:\Users\USER\Documents\Logitech Gaming Software\Profil-Screenshots\Notepad++-M3.png, x1920 b
return
It does not execute the F13 command if I press F12.
It executes the F13 command if it came from the other two programs, though.

In another script I made a very simple test, which worked:

Code: Select all

F12::
Send {F13}
return

F13::
Send F13 was pressed!
return
When pressing F12, the F13 command GETS executed correctly.
Why does the simple script work but not the one that I really need?

I also tried it with $F13:: instead of F13.
No chance either.

Best regards
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
Exaskryz
Posts: 2882
Joined: 17 Oct 2015, 20:28

Re: Issue with sending and receiving F13 - F24  Topic is solved

23 Feb 2018, 19:22

You may be able to get around these limitations by using SendLevel and/or #InputLevel.

I'll do some testing to see if it is actually a problem using the #if directive, but it may not be. (But you are sure you're inside of Notepad++ when you press F12, right?)

I had an initial suspicion that the #If would be installing a keyboard hook in a similar manner to #UseHook. These two code blocks fail to produce the MsgBox when I press F12:

Code: Select all

#If WinActive("ahk_class Notepad++")

F12::Send {F13}

F13::MsgBox Hello World

Code: Select all

#UseHook

F12::Send {F13}

F13::MsgBox Hello World
But what threw me off was your comment about the $F13. Did that it work for you in your test script? You said "No chance", which is ambiguous to me. I interpreted it to be a typo and you meant "No change". Which would imply your test script worked when using $F13 still; for me, this block also failed:

Code: Select all

F12::Send {F13}

$F13::MsgBox Hello World
Given that I can come across a similar, if not the same, issue by using #If, the suggested solution of SendLevel may do it. This works for me:

Code: Select all

#If WinActive("ahk_class Notepad++")

F12::
SendLevel, 2
Send {F13}
return

F13::MsgBox Hello World
User avatar
Scr1pter
Posts: 1272
Joined: 06 Aug 2017, 08:21
Location: Germany

Re: Issue with sending and receiving F13 - F24

23 Feb 2018, 20:01

Hi Exaskryz,

The answer to all your question is yes.
By "no chance" I meant "No chance to get it work."

I tested it with SendLevel, 2.
It works flawlessly!

Thank you very much!
Please use [code][/code] when posting code!
Keyboard: Logitech G PRO - Mouse: Logitech G502 LS - OS: Windows 10 Pro 64 Bit - AHK version: 1.1.33.09
User avatar
DavidP
Posts: 225
Joined: 10 Aug 2014, 07:31

Re: Issue with sending and receiving F13 - F24

01 Oct 2021, 11:55

Hello,

I don't know exactly if this is related, but I have the following problem:
In addition to my main keyboard, I have a second (mini) keyboard that is connected via USB.

This keyboard sends (for example) F13 and F14. F14 is recognized by AutoHotkey, but F13 is not.

What could be the reason that AutoHotkey does not recognize the F13 keystroke?

Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Lamron750 and 269 guests