# How to send a command like a real keyboard

**URL:** <https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788>\
**Category:** General\
**Created:** [22 September 2019 18:00 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788 "2019-09-22T18:00:01Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flixm](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/flixm/32/17122_2.png) [@Flixm](https://discourse.nodered.org/u/Flixm)\
**Post date:** [22 September 2019 18:00 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/1 "2019-09-22T18:00:01Z")

</div>

Hi,

i searched the whole day in the web, but i cannot find what i need.

could someone tell me how a commad (Raspberry pi with Rasbian) has to be that it simulate a real keybord input?

In my case i created a display with a raspberry which shows all time my google calender. Now i want to use some keyboard shortcuts for my web calender which runs in Chromium, like change the view from monthly to daily etc.

I want to trigger those shortcuts from a node which is controlled by Google-assistent, that´s why i´m want to start that command with a exec Node.

thanks in advance

Felix

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 September 2019 18:28 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/2 "2019-09-22T18:28:05Z")

</div>

As always, Internet search is your friend.

> <https://unix.stackexchange.com/questions/87831/how-to-send-keystrokes-f5-from-terminal-to-a-gui-program>

> **[How to simulate key press and mouse movement in Linux - Xmodulo](http://xmodulo.com/simulate-key-press-mouse-movement-linux.html)**
>
> Have you ever dreamed of your computer doing stuff automatically for you? Probably not if you just watched Terminator. But except for that, scripting and task automation are every power user's dreams. If a lot of solutions exist today to fit such...

---

<div class="post-metadata">

**Author:** ![Flixm](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/flixm/32/17122_2.png) [@Flixm](https://discourse.nodered.org/u/Flixm)\
**Post date:** [22 September 2019 21:32 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/3 "2019-09-22T21:32:29Z")

</div>

hi, this solution won´t work in a exec node, nothing happend to the chromium web site.  
i tried it in the terminal and it typed me what i wrote in the command. hmm...  
any other idea ?

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [22 September 2019 21:44 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/4 "2019-09-22T21:44:20Z")

</div>

Cannot be done directly, you will need something like [selenium](https://github.com/SeleniumHQ/selenium) to simulate input from a “script” (there are many types of software like this, search for selenium alternative)

---

<div class="post-metadata">

**Author:** ![Flixm](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/flixm/32/17122_2.png) [@Flixm](https://discourse.nodered.org/u/Flixm)\
**Post date:** [22 September 2019 21:56 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/5 "2019-09-22T21:56:21Z")

</div>

it works with xautomation ... just type the command.

Perfect , thx a lot for pushing me in the correct direction.

---

<div class="post-metadata">

**Author:** ![bakman2](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bakman2/32/6207_2.png) [@bakman2](https://discourse.nodered.org/u/bakman2)\
**Post date:** [22 September 2019 23:10 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/6 "2019-09-22T23:10:44Z")

</div>

Nice, i learned something too 😉

---

<div class="post-metadata">

**Author:** ![CarloJongen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/carlojongen/32/33683_2.png) [@CarloJongen](https://discourse.nodered.org/u/CarloJongen)\
**Post date:** [22 January 2021 14:23 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/7 "2021-01-22T14:23:56Z")

</div>

I'm not familiar with the xautomation, can you explain a bit more in detail how you got it to work? Thanks

---

<div class="post-metadata">

**Author:** ![TotallyInformation](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/totallyinformation/32/31_2.png) [@TotallyInformation](https://discourse.nodered.org/u/TotallyInformation)\
**Post date:** [22 January 2021 14:53 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/8 "2021-01-22T14:53:51Z")

</div>

> [@Flixm](#):
>
> xautomation

[xautomation(7) - Linux man page (die.net)](https://linux.die.net/man/7/xautomation)

---

<div class="post-metadata">

**Author:** ![CarloJongen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/carlojongen/32/33683_2.png) [@CarloJongen](https://discourse.nodered.org/u/CarloJongen)\
**Post date:** [22 January 2021 15:00 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/9 "2021-01-22T15:00:56Z")

</div>

Ok I'm gonna need a little bit more info on this one.. So I need to install a node that can execute a xautomation command? and what is the xautomation command to send an F11?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 January 2021 15:20 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/10 "2021-01-22T15:20:01Z")

</div>

maybe like 4th or 5th post here

> <https://raspberrypi.stackexchange.com/questions/30093/epiphany-browser-in-full-screen-mode>

---

<div class="post-metadata">

**Author:** ![CarloJongen](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/carlojongen/32/33683_2.png) [@CarloJongen](https://discourse.nodered.org/u/CarloJongen)\
**Post date:** [23 January 2021 00:30 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/11 "2021-01-23T00:30:33Z")

</div>

Seems all a bit overkill for what I need. I wanted an icon on the desktop and open it in kiosk mode. I finally ended up using the next command and it works:

´´chromium-browser --kiosk [http://localhost:1880/ui/´´](http://localhost:1880/ui/%C2%B4%C2%B4)

---

<div class="post-metadata">

**Author:** ![yasuhiro\_chida](https://avatars.discourse-cdn.com/v4/letter/y/ce73a5/32.png) [@yasuhiro\_chida](https://discourse.nodered.org/u/yasuhiro_chida)\
**Post date:** [10 October 2021 03:32 UTC](https://discourse.nodered.org/t/how-to-send-a-command-like-a-real-keyboard/15788/12 "2021-10-10T03:32:47Z")

</div>

Thank you ! It work fine with exec Node with xautomation.

xte -x:0 'key a'

But,It don't work in remote desktop.
