Answer the question
In order to leave comments, you need to log in
AutoHotkey: what script to write to change layout with Fn?
Good afternoon!
Help, please :)
I need to write a code for AutoHotkey so that on the ASUS N46VZ laptop (Windows 10) the Russian-English keyboard layout changes when the Fn button is released.
At the same time, if another button was also pressed while Fn was pressed (ie, Fn was used for a keyboard shortcut, for example, Fn + F6 brightens the screen), then the layout should not change. The behavior should be exactly like the behavior of the Win button - the Start menu only opens when the Win button is released, provided that it was pressed separately from other buttons.
Answer the question
In order to leave comments, you need to log in
You will have to find the code for the Fn key, but the code that works for me is this:
ih := InputHook("L1")
ih.KeyOpt("{All}", "NV")
ih.OnKeyDown := Func("OnKey").bind("Down")
ih.OnKeyUp := Func("OnKey").bind("Up")
ih.OnEnd := Func("OnEnd")
~LCtrl::
ih.Start()
Return
Return
OnKey(direction, ih, vk, sc) {
if (direction == "Up" and vk == 162) { ;вместо 162 код клавиши Fn
PostMessage, 0x50,0x2, ,, A
}
ih.Stop()
}
OnEnd(ih) {
ih.Stop()
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question