assigning keys on bluetooth apple keyboard
Using KeyRemap4MacBook, you could save a file like this as ~/Library/Application Support/KeyRemap4MacBook/private.xml:

&lt;?xml version="1.0"?&gt;
&lt;root&gt;
  &lt;item&gt;
    &lt;name&gt;custom&lt;/name&gt;
    &lt;identifier&gt;custom&lt;/identifier&gt;
    &lt;autogen&gt;&lt;/autogen&gt;
    &lt;autogen&gt;__KeyToKey__ KeyCode::OPTION_R, KeyCode::FORWARD_DELETE&lt;/autogen&gt;
  &lt;/item&gt;
&lt;/root&gt;


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

This only remaps Apple Wireless Keyboards:

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