how do i use keyboard Libraries?

When using the keyboard library with Due

Should I use native usb port? or Programming port??

From the Due's "Getting Started" page:

Using the Native port enables you to use the Due as a client USB peripheral (acting as a mouse or a keyboard connected to the computer)

From the Due's "Getting Started" page:

However, it works normally when connecting a programming port(connection Port,upload sketch), but when a native port is connected, only the LED lights on the board but there is no reaction to the computer

I don't own a Due so I can only go by what's in the documentation.