how do i use keyboard Libraries?

When using the keyboard library with Due
https://www.arduino.cc/reference/en/language/functions/usb/keyboard/

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)

pert:
From the Due's "Getting Started" page:
https://www.arduino.cc/en/Guide/ArduinoDue#toc13

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.