sendkey [--num|--caps|--scroll|--insert|--pause|--left-shift|--right-shift|--sysrq|--numkey|--capskey|--scrollkey|--insertkey|--left-alt|--right-alt|--left-ctrl|--right-ctrl ‘on’|‘off’]… [no-led] keystrokeInsert keystrokes into the keyboard buffer when booting. Sometimes an operating system or chainloaded boot loader requires particular keys to be pressed: for example, one might need to press a particular key to enter "safe mode", or when chainloading another boot loader one might send keystrokes to it to navigate its menu.
You may provide up to 16 keystrokes (the length of the BIOS keyboard buffer). Keystroke names may be upper-case or lower-case letters, digits, or taken from the following table:
Name Key================================================escape Escapeexclam !at @numbersign #dollar $percent %caret ^ampersand &asterisk *parenleft (parenright )minus -underscore _equal =plus +backspace Backspacetab Tabbracketleft [braceleft {bracketright ]braceright }enter Entercontrol press and release Controlsemicolon ;colon :quote ’doublequote "backquote ‘tilde ~shift press and release left Shiftbackslash \bar |comma ,less <period .greater >slash /question ?rshift press and release right Shiftalt press and release Altspace space barcapslock Caps LockF1 F1F2 F2F3 F3F4 F4F5 F5F6 F6F7 F7F8 F8F9 F9F10 F10F11 F11F12 F12num1 1 (numeric keypad)num2 2 (numeric keypad)num3 3 (numeric keypad)num4 4 (numeric keypad)num5 5 (numeric keypad)num6 6 (numeric keypad)num7 7 (numeric keypad)num8 8 (numeric keypad)num9 9 (numeric keypad)num0 0 (numeric keypad)numperiod . (numeric keypad)numend End (numeric keypad)numdown Down (numeric keypad)numpgdown Page Down (numeric keypad)numleft Left (numeric keypad)numcenter 5 with Num Lock inactive (numeric keypad)numright Right (numeric keypad)numhome Home (numeric keypad)numup Up (numeric keypad)numpgup Page Up (numeric keypad)numinsert Insert (numeric keypad)numdelete Delete (numeric keypad)numasterisk * (numeric keypad)numminus - (numeric keypad)numplus + (numeric keypad)numslash / (numeric keypad)numenter Enter (numeric keypad)delete Deleteinsert Inserthome Homeend Endpgdown Page Downpgup Page Updown Downup Upleft Leftright RightAs well as keystrokes, the sendkey command takes various options that affect the BIOS keyboard status flags.
These options take an on or off parameter, specifying that the corresponding status flag be set or unset; omitting the option for a given status flag will leave that flag at its initial state at boot. The --num, --caps, --scroll, and --insert options emulate setting the corresponding mode, while the --numkey, --capskey, --scrollkey, and --insertkey options emulate pressing and holding the corresponding key. The other status flag options are self-explanatory.
If the --no-led option is given, the status flag options will have no effect on keyboard LEDs.
If the sendkey command is given multiple times, then only the last invocation has any effect.
Since sendkey manipulates the BIOS keyboard buffer, it may cause hangs, reboots, or other misbehavior on some systems. If the operating system or boot loader that runs after GRUB uses its own keyboard driver rather than the BIOS keyboard functions, then sendkey will have no effect.
This command is only available on PC BIOS systems.