Hello, sorry for bumping into an old thread. I found a way to make FN work, but not as a combination key in one press, but based on step, take example, I want my X220 fn+f3 mapped to changing the battery profile on windows 7 (I only test this on Win7), so using AHK/AutoHotkey, we can map it using this code :
Code: Select all
; Workaround for FN Key
SC163::
FnKey=1
Sleep, 1000
FnKey=0
return
;Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced)
;Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)
;Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver) *
#If FnKey=1
F3::
;tmp := ComObjCreate("WScript.Shell").Exec("powercfg.exe -GETACTIVESCHEME").StdOut.ReadAll()
pwr:= DllCall("powrprof.dll\PowerGetActiveScheme", "Ptr", 0, "Ptr*", oldSchemeGUID, "Uint")
pwr:= Dllcall("powrprof.dll\PowerReadFriendlyName", "Ptr", 0, "Ptr", oldSchemeGUID, "Ptr", 0, "Ptr", 0, "Ptr", 0, "Ptr*", szdesc)
;sdesc :LPDWORD
sleep 150
;MsgBox % szdesc
;if (InStr(tmp,"Power saver") == 0)
if (szdesc == 126)
{
Run, powercfg.exe -SETACTIVE a1841308-3541-4fab-bc81-f71556f20b4a,, "Hide"
}
else
{
Run, powercfg.exe -SETACTIVE 381b4222-f694-41f0-9685-ff5bb260df2e,, "Hide"
}
; Choose the second power plan in the list
; Revert to default plan and cleanup
FnKey=0
return
What this code do is, it catch the FN key using SC163, because in thinkpad X220, thank god, it is readable key, so we can use it as a short toggle in 1s by pressing it, then press another F3 key. so we press FN first, then F3, but NOT AT THE SAME TIME! You can test the powrprof.dll output using your own number on your computer, or do anything else with it. At least, with this, it close the gap of lenovo enhanced experince that I don't get from windows 7, sadly, and I don't want to do win7 restore, because of cummulative update and patch that I already done. it also make the other FNFX key overwriteable, but in different way, and you also could by theory, map FN+A to FN+anything on the keyboard, just your muscle memory need to remember that those remap, you need to release the FN, then press the other key, in order to make it work.
This approach based on
https://www.autohotkey.com/board/topic/ ... /?p=639524
https://www.autohotkey.com/boards/viewtopic.php?t=68530
https://www.autohotkey.com/board/topic/ ... using-ahk/
Hope this helps!