Assigning keys on bluetooth apple keyboard

keyboard

I have assigned the right "alt" key on my 2013 MacBook Air to act as a forward delete – using DoubleCommand. Works like a charm. I then installed an apple bluetooth keyboard to use on an external monitor connected to the MacBook Air. How do I make the right "alt" key on the bluetooth keyboard also act as a forward delete?

Best Answer

Using KeyRemap4MacBook, you could save a file like this as ~/Library/Application Support/KeyRemap4MacBook/private.xml:

<?xml version="1.0"?>
<root>
  <item>
    <name>custom</name>
    <identifier>custom</identifier>
    <autogen></autogen>
    <autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::FORWARD_DELETE</autogen>
  </item>
</root>

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

This only remaps Apple Wireless Keyboards:

<?xml version="1.0"?>
<root>
  <devicevendordef>
    <vendorname>APPLE</vendorname>
    <vendorid>0x05AC</vendorid>
  </devicevendordef>
  <deviceproductdef>
    <productname>WIRELESSKEYBOARD</productname>
    <productid>0x0255</productid>
  </deviceproductdef>
  <item>
    <name>custom</name>
    <identifier>custom</identifier>
    <device_only>DeviceVendor::APPLE, DeviceProduct::WIRELESSKEYBOARD</device_only>
    <autogen>__KeyToKey__ KeyCode::OPTION_R, KeyCode::FORWARD_DELETE</autogen>
  </item>
</root>