Remapping Hotkeys on Lenovo Thinkpad P53

Get help with using AutoHotkey (v1.1 and older) and its commands and hotkeys
mtira
Posts: 2
Joined: 16 Nov 2019, 19:44

Remapping Hotkeys on Lenovo Thinkpad P53

16 Nov 2019, 19:56

Hello, I am trying to remap some of the hot keys in the Fn bar on my new Lenovo computer. I am really new to AHK and programming in general, but I want to remap the function of the hotkeys above the f8 (Airplane mode toggle), f9(settings), f10(bluetooth), f11(Keyboard settings in lenovo vantage app?) and f12 keys (Lenovo programable hotkey with limited usages). I already was able to remap the button for f7(external display settings) but can't find the other keys using the special key finding technique outlined in the manual:
" 1.Ensure that at least one script is running that is using the keyboard hook. You can tell if a script has the keyboard hook by opening its main window and selecting "View->Key history" from the menu bar.
2.Double-click that script's tray icon to open its main window.
3.Press one of the "mystery keys" on your keyboard.
4.Select the menu item "View->Key history"
5.Scroll down to the bottom of the page. Somewhere near the bottom are the key-down and key-up events for your key. NOTE: Some keys do not generate events and thus will not be visible here. If this is the case, you cannot directly make that particular key a hotkey because your keyboard driver or hardware handles it at a level too low for AutoHotkey to access. For possible solutions, see further below.
6.If your key is detectable, make a note of the 3-digit hexadecimal value in the second column of the list (e.g. 159).
7.To define this key as a hotkey, follow this example:
"

I wrote this code, if you can call it that to just start collecting keys, which helped me find the f7 SC.

However, I can't find the SCs for any of the other keys I want to remap, and I don't quite know what to do about it. When I try to use the method no key turns up.

If possible I would like to only remap those keys, and have the other keys remain the default hotkeys. Or, figure out how to program the default fkeys to have the features I like on them, like brightness and volume. My goal would be to reprogram the other ones to control media, like a mac keyboard, and to turn off the display. I think this should be possible as I have seen other codes for controlling media, and a script for turning off the display, but I first need to find the SC key value for those keys.
Last edited by mtira on 16 Nov 2019, 20:08, edited 1 time in total.
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Remapping Hotkeys on Lenovo Thinkpad P53

16 Nov 2019, 20:00

my T480s Thinkpad has FnLock which is enabled with Fn+ESC, and then all of the F-keys turn into their normal functions, and then you could just remap F8 directly for example

mtira
Posts: 2
Joined: 16 Nov 2019, 19:44

Re: Remapping Hotkeys on Lenovo Thinkpad P53

16 Nov 2019, 20:06

That makes sense, however I want to keep the other hotkeys funcitonal. I like having hte volume keys as hot keys, and the brightness keys as hot keys. I also like being able to use the f keys in excel and other programs.
guest3456
Posts: 3463
Joined: 09 Oct 2013, 10:31

Re: Remapping Hotkeys on Lenovo Thinkpad P53

16 Nov 2019, 20:42

mtira wrote:
16 Nov 2019, 20:06
That makes sense, however I want to keep the other hotkeys funcitonal. I like having hte volume keys as hot keys, and the brightness keys as hot keys. I also like being able to use the f keys in excel and other programs.
Well with FnLock turned on, then those functions are still hotkeys, but you just have to press FN+key in order to activate them. So for me, instead of pressing F3 to raise volume, now I press Fn+F3. To raise brightness, I press Fn+F6

And then I'm free to remap the regular F3 or F6 or whatever keys within AHK.

Just offering an alternative if you cannot find those SC codes. For example, my F9 key has an icon of a gear, and pressing it opens up Win10 Settings window. But when I look in KeyHistory to try to get the SC code, I dont see any value, I instead see LWin and i, and what do you know, if i press LWin+i then it also opens up Settings. So maybe Lenovo is simply doing an hardware remap to those keys, and there is no SC code


Return to “Ask for Help (v1)”

Who is online

Users browsing this forum: Google [Bot] and 274 guests