The xdotool manpage says:
key: Type a given keystroke.
type: Types as if you had typed it.
It is beyond my understanding. Could you explain how they differ?
The xdotool manpage says:
key: Type a given keystroke.
type: Types as if you had typed it.
It is beyond my understanding. Could you explain how they differ?
Basically type will type a string, key will type individual keys or key combos. For example here's two ways to type "Hello world!":
xdotool type "Hello world!"
xdotool key H e l l o space w o r l d exclam
More info from man xdotool (trimmed down a bit):
key keystroke [keystroke ...]
Type a given keystroke. Examples being "alt+r", "Control_L+J", "ctrl+alt+n",
"BackSpace". Multiple keys are separated by '+'.
Example: Send the keystroke "F2"
xdotool key F2
Example: Send 'a' with an accent over it (not on English keyboards, but
still works with xdotool)
xdotool key Aacute
Example: Send ctrl+l and then BackSpace as separate keystrokes:
xdotool key ctrl+l BackSpace
type something to type
Types as if you had typed it. Supports newlines and tabs (ASCII newline and
tab).
Example: to type 'Hello world!' you would do:
xdotool type 'Hello world!'