It is possible to make an Arduino look more like a real USB keyboard using the IDE. This is useful for Assistive Tech or a keyboard extender where sometimes old computers running OSes such as XP are confused by the Arduino Pluggable USB descriptors and the extraneous USB serial port.
Some AVR Core files must be modified. After these changes are made, the Leonardo no longer appears with a USB serial port so uploading new firmware from the IDE is no longer automatic. But the extra step is easy.
Double click on the Leonardo RESET button to force the Leonardo into bootloader mode. The USB serial port should appear. Press the Upload button in the IDE to upload new firmware. Modifying the AVR Core files does not change the bootloader so this should always work.
This project has modified AVR Core files. It was supposed to be part of an USB extender and/or IP KVM but I am not working on it any more.
I found copying the AVR Core files into the same directory as the sketch then modifying them works. The IDE seems to override the files in the AVR board package directory if it finds them in the sketch directory. This is Good because if the Core files are modified in the package directory, the next update to the AVR board package will overwrite the changes!