Next: , Previous: , Up: Command-line commands   [Contents][Index]


17.4.66 sendkey

Command: sendkey [--num|--caps|--scroll|--insert|--pause|--left-shift|--right-shift|--sysrq|--numkey|--capskey|--scrollkey|--insertkey|--left-alt|--right-alt|--left-ctrl|--right-ctrlon’|‘off’]… [no-led] keystroke

Insert 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.

Note: This command is currently only available on the i386-pc target.

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:

NameKey
escapeEscape
exclam!
at@
numbersign#
dollar$
percent%
caret^
ampersand&
asterisk*
parenleft(
parenright)
minus-
underscore_
equal=
plus+
backspaceBackspace
tabTab
bracketleft[
braceleft{
bracketright]
braceright}
enterEnter
controlpress and release Control
semicolon;
colon:
quote
doublequote"
backquote
tilde~
shiftpress and release left Shift
backslash\
bar|
comma,
less<
period.
greater>
slash/
question?
rshiftpress and release right Shift
altpress and release Alt
spacespace bar
capslockCaps Lock
F1F1
F2F2
F3F3
F4F4
F5F5
F6F6
F7F7
F8F8
F9F9
F10F10
F11F11
F12F12
num11 (numeric keypad)
num22 (numeric keypad)
num33 (numeric keypad)
num44 (numeric keypad)
num55 (numeric keypad)
num66 (numeric keypad)
num77 (numeric keypad)
num88 (numeric keypad)
num99 (numeric keypad)
num00 (numeric keypad)
numperiod. (numeric keypad)
numendEnd (numeric keypad)
numdownDown (numeric keypad)
numpgdownPage Down (numeric keypad)
numleftLeft (numeric keypad)
numcenter5 with Num Lock inactive (numeric keypad)
numrightRight (numeric keypad)
numhomeHome (numeric keypad)
numupUp (numeric keypad)
numpgupPage Up (numeric keypad)
numinsertInsert (numeric keypad)
numdeleteDelete (numeric keypad)
numasterisk* (numeric keypad)
numminus- (numeric keypad)
numplus+ (numeric keypad)
numslash/ (numeric keypad)
numenterEnter (numeric keypad)
deleteDelete
insertInsert
homeHome
endEnd
pgdownPage Down
pgupPage Up
downDown
upUp
leftLeft
rightRight

As 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 misbehaviour 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.


Next: , Previous: , Up: Command-line commands   [Contents][Index]