So I've recently installed Ubuntu 14.04 (kernel: 3.13.0-24-generic). It's mostly working with my Samsung NP540U4E laptop, just having some trouble with the keyboard brightness change function keys.
dmesg | grep -i setkeycodes
shows me that the scancodes are e017 for brightness down (Fn + F9) and e016 for brightness up (Fn + F10).
gives me the output (among other things)
keycode 237 = XF86KbdBrightnessDown NoSymbol XF86KbdBrightnessDown keycode 238 = XF86KbdBrightnessUp NoSymbol XF86KbdBrightnessUp
which I think are correct commands because
xdotool key XF86KbdBrightnessUp xdotool key XF86KbdBrightnessDown
change the keyboard brightness up and down. I then tried
sudo setkeycodes e017 237 sudo setkeycodes e016 238
which didn't work, but for some reason if I subtract 8 from the keycodes they work for keyboard brightness up and down but now I have another problem. My laptop doesn't register these keys being released so they both only work once as my laptop thinks they are still held. And I couldn't see a scancode for the release of the keys