(USB keyboard + keyboard+lcd +due) using facing problem of getting same output

Does it work if you replace your loop() function with this:

void keyPressed()
{
  int x = keyboard.getOemKey();
  if (x == 58) lcd.print("F1 is ptressed");
  if (x == 59) lcd.print("F2 is ptressed");
  if (x == 60) lcd.print("F3 is ptressed");
}

void loop()
{
  // Process USB tasks
  usb.Task();
}
1 Like