MacOS – Use Caps lock key to click without 3rd-party software

caps-lockkeyboardmacos

Clicking became very difficult on my early 2009, 17" MacBook Pro with Mavericks (10.9.1).
I thought about using the Caps Lock key to send a mouse click.

I saw this question with an answer involving a third-party tool, but I wish to find a more low-level solution.

Best Answer

I don't know any way to do it without third party software, but it is possible with KeyRemap4MacBook and PCKeyboardHack.

First use PCKeyboardHack to change caps lock to F19. Then save this file as ~/Library/Application Support/KeyRemap4MacBook/private.xml:

<?xml version="1.0"?>
<root>
  <item>
    <name>f19toclick</name>
    <identifier>f19toclick</identifier>
    <autogen>__KeyToKey__ KeyCode::F19, PointingButton::LEFT</autogen>
  </item>
</root>

Then open the KeyRemap4MacBook application, press the ReloadXML button, and enable the setting.