Easy Project, just one question

I got a Nano Arduino v3.0

I have a programmer USBASP 2.0

I have a matrix keyboard 3x4

Sketch works on serial monitor

I need the PC recognize it as a Keyboard, I need to use it like buttons into another program, like a normal keyboard, for example: if I open NotePad I want to input characters using matrix keyboard and Nano Arduino.

Is it possible?

Full code:

#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 3; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
{'0','1','2'},
{'4','5','6'},
{'8','9','A'},
{'C','D','E'}
};
byte rowPins[ROWS] = {8,7, 6, 5}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {4, 3, 2}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);

void setup(){
Serial.begin(9600);
}

void loop(){
char customKey = customKeypad.getKey();

if (customKey){
Serial.println(customKey);
}
}

It's not possible. Use a 32U4 based Arduino that supports it.

You can use V-USB library

#include "UsbKeyboard.h"

#define PIN_BUTTON 7 // the button is attached to pin 7

int lastState = LOW; // LOW is equivalent to 0

void setup() {
  //  button setup
  pinMode(PIN_BUTTON, INPUT);

  // USB setup -----------------
  // Disable timer0 since it can mess with the USB timing. Note that
  // this means some functions such as delay() will no longer work.
  TIMSK0 &= !(1<TOIE0);
  // Clear interrupts while performing time-critical operations
  cli();

  // Force re-enumeration so the host will detect us
  usbDeviceDisconnect();
  delayMs(250);
  usbDeviceConnect();

  // Set interrupts again
  sei();
}

void loop() {
  // update USB device state
  UsbKeyboard.update();

  // check, if transition to button-pressed has occured
  if( (digitalRead(PIN_BUTTON) == HIGH) && (lastState==LOW) ) {
    UsbKeyboard.sendKeyStroke(KEY_A); // if so, send the letter 'a' via USB keyboard
    lastState = HIGH; // update the state variable
    delay(10); // simple de-bouncing
  // check, if the button was released
  } else if( (digitalRead(PIN_BUTTON) == LOW) && (lastState==HIGH) ) {
    lastState = LOW; // if so, update the state variable
    delay(10); // simple de-bouncing
  }

}

// helper method for V-USB library
void delayMs(unsigned int ms) {
  for( int i=0; i<ms; i++ ) {
    delayMicroseconds(1000);
  }
}