Hi,
I dont know if this is the same as your problem, but when i went to do that on the Micro (Arduino) i had this:
#include Keyboard.h
and it gave an error for that line, and i found out later that you dont include that anymore. So i remmed it out:
//#include Keyboard.h
and it worked fine after that.
I dont know if this is the same with the Due though, i had not tried that yet.
Good luck with it.