Remapping Function Key to do Copy and Paste with AutoHotKey
The copy and paste keystroke combinations of Ctrl-C and Ctrl-V in Windows are used so frequently, it is surprising that there is not a single function key for that. You have to do a double key combination with the left-hand which can be hard on the hand. And it is not typically not possible to do the key combination with the right hand.
There may be some external keyboards that have the copy and paste buttons on them, but if you are using the keyboard on the laptop, there is no built-in control panel settings to remap the function keys to do the copy to and paste from clipboard function.
Fortunately, there is a free open-source utility called AutoHotKey which can remap your function keys to do the Ctrl-C and Ctrl-V combinations.
After downloading and installing the AutoHotKey_L from autohotkey.com, run the autohotkey.exe program. It will ask if you want it to create an sample AutoHotKey.ahk script on your “My Documents” folder in Windows. Say yes. Then you can open and edit that AutoHotKey.ahk script and put in commands such as …
The first line says that if you press the F1 function key, then it will perform the Ctrl-C instead. The second line says pressing F2 will do a Ctrl-V to paste. And F3 to cut.
Since the CapsLock key is hardly used, I like to map it to the “copy to clipboard” command. Note that now you can press either CapsLock or F1 to do the “copy”.
To run the Autohotkey script, just double-click on the autohotkey.ahk. Because this script is named autohotkey.ahk, it means that this script will run if you run autohotkey.exe as well.
When autohotkey is running (as noted by the green autohotkey icon on the system tray), the remapping takes place and the original functionality of the CapsLock, F1, F2, F3 key will no longer work. If you want to turn of the remapping, just right-click on the green autohotkey icon on the system tray and select exit. Now your keyboard is back to normal.
Autohotkey has many more features including programming constructs and compiling into an executable. But for key remapping, you don’t need all that. And sometimes compiling it into an executable can trigger off your anti-virus/anti-malware software.
There are other key mapping programs out there. But you have to be careful that they do not contain malware that may record your keystrokes (such as when you are typing in a password, etc).
Autohotkey has been around for a long time. According to Wikipedia, developer Chris Mallett released the beta of AutoHotkey in 2003. The program is well-known and is on Wikipedia. It has been reviewed by CNet. And because it is open-source, the source code is downloadable for anyone to review. Hence, it is unlikely that this software has any malware in it. I have my anti-virus/anti-malware software up-to-date. And for the simple keymapping shown above, it has never triggered my anti-virus/anti-malware software.