Why does my xdotool key command not work?

15,679

The correct command is:

xdotool key Control_L+Super_L+d

To find the correct key- mentions, use xev: In a terminal window, run the command xev + Return, then type the key you'd like to use in the xdotool command. The output will be like:

KeyPress event, serial 37, synthetic NO, window 0x4c00001,
    root 0x260, subw 0x0, time 64862215, (-177,259), root:(1325,592),
    state 0x10, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    XLookupString gives 0 bytes: 
    XmbLookupString gives 0 bytes: 
    XFilterEvent returns: False

where the information you are looking for is in the section:

(keysym 0xffeb, Super_L)

Alternatively, you can use the keysym -value:

xdotool key Control_L+0xffeb+d

or the key code:

xdotool key Control_L+133+d

Additional information

As mentioned by @DKBose:
on 14.04, the command, used by OP should work, as mentioned in man xdotool on 14.04.3:

Generally, any valid X Keysym string will work. Multiple keys are separated by '+'. Aliases exist for "alt", "ctrl", "shift", "super", and "meta" which all map to Foo_L, such as Alt_L and Control_L .

However, OP mentions the tag 15.04, and on 15.04, the passage is missing in man xdotool, and the aliasses do not work any more. The values, found in the output of xev should be used.

Share:
15,679

Related videos on Youtube

Iman  Mohamadi
Author by

Iman Mohamadi

Updated on September 18, 2022

Comments

  • Iman  Mohamadi
    Iman Mohamadi almost 2 years

    I'm trying to run this command:

    xdotool key ctrl+super+d
    

    It is supposed to toggle-show desktop, but it won't work. When I press the keys myself it works though.

    • Pablo Bianchi
      Pablo Bianchi over 7 years
      From 12.04+ don't you have that feature with Ctrl+Super+D?
  • Jacob Vlijm
    Jacob Vlijm over 8 years
    @DKBose Good point, however, on 15.04 the passage is missing in man xdotool, and it is not working either. I will add it to the answer.
  • Jacob Vlijm
    Jacob Vlijm over 8 years
    @DKBose that is odd. All I can say is aliasses do work on 14.04 here, but not on 15.04. The output of xev works in all cases however.