Autohotkey to simulate Home and End keys

What other productivity software are you working with...
Post Reply
grindax

Autohotkey to simulate Home and End keys

Post by grindax » 15 Jul 2014 16:29

.
Last edited by grindax on 24 Jan 2016 12:08, edited 1 time in total.

binocular222
Posts: 1410
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Re: Autohotkey to simulate Home and End keys

Post by binocular222 » 15 Jul 2014 16:50

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

SammaySarkar
Posts: 4190
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Autohotkey to simulate Home and End keys

Post by SammaySarkar » 15 Jul 2014 17:12

I think assigning Fn in AHK will be difficult. Still,try this:
• Execute the following AHK script.

Code: Select all

#persistent
#InstallKeybdHook
• 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:

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 
• 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:

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
text slightly modified from: http://www.autohotkey.com/docs/KeyList.htm

grindax

Re: Autohotkey to simulate Home and End keys

Post by grindax » 15 Jul 2014 17:31

.
Last edited by grindax on 24 Jan 2016 12:08, edited 1 time in total.

SammaySarkar
Posts: 4190
Joined: 12 Mar 2014 17:27
Location: Asteroid B-612 / Dhaka
Contact:

Re: Autohotkey to simulate Home and End keys

Post by SammaySarkar » 15 Jul 2014 17:33

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?

grindax

Re: Autohotkey to simulate Home and End keys

Post by grindax » 15 Jul 2014 21:04

.
Last edited by grindax on 24 Jan 2016 12:08, edited 1 time in total.

grindax

Re: Autohotkey to simulate Home and End keys

Post by grindax » 16 Jul 2014 00:04

.
Last edited by grindax on 24 Jan 2016 12:08, edited 1 time in total.


Post Reply