Autohotkey to simulate Home and End keys
Autohotkey to simulate Home and End keys
.
Last edited by grindax on 24 Jan 2016 12:08, edited 1 time in total.
-
- Posts: 1416
- Joined: 04 Nov 2008 05:35
- Location: Hanoi, Vietnam
Re: Autohotkey to simulate Home and End keys
Depend on devices, I have never successed with my laptop's Fn
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488
Re: Autohotkey to simulate Home and End keys
I think assigning Fn in AHK will be difficult. Still,try this:
• Execute the following AHK script.
• Try NOT to press any more keyboard keys from this point.
• Double-click that script's tray icon to open its main window.
• Press the SPACEBAR. Press the fn key. Press SPACEBAR again.
• Select the menu item "View->Key history..."
• At the end of the visible text, you'll find the keydown and keyup records of Space, fnkey, Space IF your key was detected (else just two space keys are listed). Like this:
• If your key was detected, make a note of the 3-digit hexadecimal value in the second column of the list (e.g. 159).
• To define this key as a hotkey, follow this example:
text slightly modified from: http://www.autohotkey.com/docs/KeyList.htm
• Execute the following AHK script.
Code: Select all
#persistent
#InstallKeybdHook
• Double-click that script's tray icon to open its main window.
• Press the SPACEBAR. Press the fn key. Press SPACEBAR again.
• Select the menu item "View->Key history..."
• At the end of the visible text, you'll find the keydown and keyup records of Space, fnkey, Space IF your key was detected (else just two space keys are listed). Like this:
Code: Select all
20 039 d 5.69 Space
20 039 u 0.16 Space
xx xxx d 0.34 FnKey
xx xxx u 0.16 FnKey
20 039 d 0.27 Space
20 039 u 0.13 Space
• To define this key as a hotkey, follow this example:
Code: Select all
~SCxxx & Left:: ; Replace xxx with your key's value.
send {Home}
return
~SCxxx & Right:: ; Replace xxx with your key's value.
send {End}
return
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Autohotkey to simulate Home and End keys
.
Last edited by grindax on 24 Jan 2016 12:08, edited 1 time in total.
Re: Autohotkey to simulate Home and End keys
Hmm, then the Fn key wasn't detected. There may be other ways, but I know none of them, wait for other AHK gurus. Or you can pay a visit to the AHK forum...
EDIT: curious: if you press FN+Left key, does that generate a different code than just pressing Left key?
EDIT: curious: if you press FN+Left key, does that generate a different code than just pressing Left key?
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
Re: Autohotkey to simulate Home and End keys
.
Last edited by grindax on 24 Jan 2016 12:08, edited 1 time in total.
Re: Autohotkey to simulate Home and End keys
.
Last edited by grindax on 24 Jan 2016 12:08, edited 1 time in total.