Remapping Asus laptop Fn keys

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
bhoot
Posts: 4
Joined: 05 May 2024, 21:28

Remapping Asus laptop Fn keys

05 May 2024, 21:38

I just got a new Asus Zenbook. It comes with F1-F12 remapped already to various useful functions (volume, brightness, etc.). One (F12) is not useful: it opens their MyAsus software. I want to remap it.

The problem is that I can't capture whatever the remapped F12 is doing using the Key History. Nothing registers there. I've read (here: https://www.autohotkey.com/docs/v2/KeyList.htm#SpecialKeys) about what to do if your key isn't detectable by Key History, but I don't understand what AHKHID is.

Can anyone advise if there's anything I can do to try to figure out how to remap this key?

There is a way to turn off their default remapping and make them all just F1-F12 again, but that's the last resort, because all the other remappings that come as the default are genuinely useful, and I'm not sure I could reproduce them all with AHK. Any help would be appreciated!
Rohwedder
Posts: 7706
Joined: 04 Jun 2014, 08:33
Location: Germany

Re: Remapping Asus laptop Fn keys

06 May 2024, 00:54

Hallo,
but F1-F11 can be configured back via this MyAsus software?
If so, then gradually replace them with Autohotkey functions. You will discover a new world of possibilities. Otherwise, stay in your (not really) golden cage.
bhoot
Posts: 4
Joined: 05 May 2024, 21:28

Re: Remapping Asus laptop Fn keys

07 May 2024, 07:36

Thanks for taking the time to reply!

Unfortunately, their software only lets you turn the pre-set remapping on or off. It doesn't let you select specific keys. If I turn their version off, it causes several problems, especially since Autohotkey can't interact with the Fn function on the laptop and their pre-sets interact with features AHK apparently can't access. It is a possible solution, but it will be a worse user experience than if I could just remap F12 as it stands.

So, the best solution would be to find a way to remap their remapped version of F12, but I'm not sure that's possible.

Is there some way to figure out exactly what pressing F12 is doing? If the Key History doesn't capture it, is there some other way to identify what command it currently executes, so I could maybe remap that?

Or maybe, if I could figure out where that key is pointing to activate that program (i.e., if I could find the shortcut or EXE file for that program), is there a way to write an Autohotkey script that says "Any time this program is about to be activated, do this other thing instead?"

Again, any suggestions very welcome!
User avatar
mikeyww
Posts: 27165
Joined: 09 Sep 2014, 18:38

Re: Remapping Asus laptop Fn keys

07 May 2024, 08:01

You could write a script that detects the opening of MyASUS. It could then close the window and do something different. It would be a clunky approach, but I do not know a way to assign that key sequence on ASUS. I suppose you could also try replacing the program itself, but I do not recommend it.

viewtopic.php?p=394008#p394008

viewtopic.php?f=76&t=81807

viewtopic.php?p=367333#p367333

viewtopic.php?t=59644
bhoot
Posts: 4
Joined: 05 May 2024, 21:28

Re: Remapping Asus laptop Fn keys

07 May 2024, 13:12

Thanks very much for the response and for pointing me to those other posts! I will read them and see if I can figure it out.

For what it's worth, I can uninstall MyAsus, in which case, the F12 key just doesn't do anything at all. It seems like there should be some way to figure out what the output of pressing the key is and then preempt it somehow, but I don't know how to even see what it's doing, since it doesn't show up in Key History.

I'm going to check out AHKHID, but I don't understand what it is or what it does. I will read more about it.

Assuming that this key is pointing to some particular EXE file somewhere, would it be possible to write an AHK script that says "Whenever this EXE file is activated, instead of executing the file do something else instead?" That's kind of like the window-opening solution, but maybe would be faster? I

In the same vein, does anyone know how I might be able to figure out exactly what that key is doing, since it doesn't show up in the Key History?

Thanks very much for your help!
User avatar
mikeyww
Posts: 27165
Joined: 09 Sep 2014, 18:38

Re: Remapping Asus laptop Fn keys

07 May 2024, 13:43

As I mentioned, you could try replacing the program. It is AsusMyASUS.exe in your AppsFolder, but my advice would be to use a different hotkey instead of attempting to do this.

You might want to read the cited posts as a way to learn more about the answer to your question.
User avatar
Seven0528
Posts: 393
Joined: 23 Jan 2023, 04:52
Location: South Korea
Contact:

Re: Remapping Asus laptop Fn keys

07 May 2024, 13:50

bhoot wrote:
07 May 2024, 13:12
Assuming that this key is pointing to some particular EXE file somewhere, would it be possible to write an AHK script that says "Whenever this EXE file is activated, instead of executing the file do something else instead?" That's kind of like the window-opening solution, but maybe would be faster? I
Thanks very much for your help!
 You can achieve what you want indirectly.
For instance, you could send a message to the main script when a specific .exe file is executed.
Alternatively, you could design an .exe file that does nothing but immediately exits upon execution, and then your main script could detect when a new process is created.

I don't have any knowledge about Asus programs, and I can't test anything, so it's difficult for me to offer further advice...
  • English is not my native language. Please forgive any awkward expressions.
  • 영어는 제 모국어가 아닙니다. 어색한 표현이 있어도 양해해 주세요.
User avatar
mikeyww
Posts: 27165
Joined: 09 Sep 2014, 18:38

Re: Remapping Asus laptop Fn keys

07 May 2024, 13:54

A simple approach is stated in my first post: you could write a script that detects the opening of MyASUS. It could then close the window and do something different.
bhoot
Posts: 4
Joined: 05 May 2024, 21:28

Re: Remapping Asus laptop Fn keys

08 May 2024, 20:21

Thank you very much! I appreciate you taking the time to offer advice, and I will try to see what I can figure out, including reviewing the linked posts (thanks for those links!). If I can get it to work, I will report back on what I did.
awkwrd
Posts: 15
Joined: 26 Feb 2023, 21:04

Re: Remapping Asus laptop Fn keys

09 May 2024, 04:21

I don't have an Asus laptop, so I can't test, but I have an idea:
1. Rename AsusMyASUS.exe to something else like "AsusMyASUS_backup.exe"
2. Write your autohotkey script and compile it to exe. Rename your exe to AsusMyASUS.exe and put it in your AppsFolder.
3. If it works then F12 would run your autohotkey script instead of MyAsus

If this works then it should be faster than waiting for MyASUS to open then detecting it.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: No registered users and 16 guests