I want to use keyboard function in Arduino Uno. But as you know it is not compatible. So what is the alternative to keyboard library in Arduino Uno?
The Arduino Uno does not support that functionality - you need a microcontroller with native USB so you can tell it to act as a keyboard instead of USB serial; the Uno uses an external serial adapter and a microcontroller without USB.
An Arduino like the Leonardo/Micro/Pro Micro stays within the AVR family but offers native USB so you can use the keyboard library normally. The Due and I think the Zero also have native USB.
There are ways on the official unos (not the clones with other serial adapters), because the 16u2 being used as serial adapter can be reprogrammed, but this is not a good project for someone who is new to Arduino, which it sounds like you are. You need to load new firmware on the 16u2 using ISP programming or DFU w/Atmel FLIP.