Triggering line feed using the keyboard modifiers

The Keyboard library defines KEY_RETURN for the Return/Enter key.

Usually, the keyboard only sends the Return/Enter key code and it is up to the operating system to decide if that means CR, LF, or CRLF.

To type an explicit CR or LF you should use:

  Keyboard.press(KEY_LEFT_CTRL); Keyboard.press('m'); Keyboard.releaseAll(); // CR=Ctrl-M
  Keyboard.press(KEY_LEFT_CTRL); Keyboard.press('j'); Keyboard.releaseAll(); // LF=Ctrl-J

Rather than using "Keybord.press()" followed immediately be "Keyboard.release()" you can use "Keybord.write()" which does both.

Note: When you .print() or .write() the Linefeed character (ASCII 10 or 0x0A) to Keyboard it maps to the Return/Enter key. The Carriage Return character (ASCII 13 or 0x0D) maps to zero (no mapping).