Exploring Keyboard Input Virtualization via Serial Communication with ESP: Feasibility and Simulated Key Press

Good morning, I would like to know if it's possible for me to virtualize a keyboard input, using a serial communication with the ESP. When I press the button connected to the ESP, would the ESP be able to indicate that it has been pressed? Additionally, could the program simulate a key press based on this input? Is this achievable?