# Sendkeys to enter fullscreen

**URL:** <https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642>\
**Category:** General\
**Created:** [7 November 2018 12:27 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642 "2018-11-07T12:27:37Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![BastianG](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@BastianG](https://discourse.nodered.org/u/BastianG)\
**Post date:** [7 November 2018 12:27 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642/1 "2018-11-07T12:27:38Z")

</div>

Hi there.

Anyone have experience using sendkeys?

I would like to make a button on my dashboard which sends F11 to my system when clicking the button. (Hopefully the screen will go to full screen then) 🙂

I this the way to do it, and how should i implement it. I have a hard time understanding how the block works.

Best Regards

---

<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:** [7 November 2018 16:27 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642/2 "2018-11-07T16:27:52Z")

</div>

Well the keystroke will go to the "server" which then somehow has to get back to the browser and do the necessary... I think what you really want is to try to use a template to do this - [https://www.w3schools.com/howto/howto\_js\_fullscreen.asp](https://www.w3schools.com/howto/howto_js_fullscreen.asp)

---

<div class="post-metadata">

**Author:** ![BastianG](https://avatars.discourse-cdn.com/v4/letter/b/df705f/32.png) [@BastianG](https://discourse.nodered.org/u/BastianG)\
**Post date:** [8 November 2018 13:24 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642/3 "2018-11-08T13:24:00Z")

</div>

Perfect - that works 🙂 Thanks

---

<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:** [8 November 2018 16:09 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642/4 "2018-11-08T16:09:58Z")

</div>

Feel free to share your template here so we can share with others. Thanks

---

<div class="post-metadata">

**Author:** ![kauan-AF](https://avatars.discourse-cdn.com/v4/letter/k/ee7513/32.png) [@kauan-AF](https://discourse.nodered.org/u/kauan-AF)\
**Post date:** [7 February 2020 21:52 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642/5 "2020-02-07T21:52:00Z")

</div>

I get through this forum and get it to.  
[{"id":"911e3d0e.7d6e9","type":"ui\_template","z":"fb66ed32.2ae5","group":"5a956c96.cfca64","name":"","order":2,"width":0,"height":0,"format":"\n\<md-button ng-click="send({payload:action()})"\>\n Fullscreen\n","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":300,"y":1380,"wires":[]},{"id":"5a956c96.cfca64","type":"ui\_group","z":"","name":"Saving Data","tab":"f2edd282.5445a","order":3,"disp":true,"width":6,"collapse":false},{"id":"f2edd282.5445a","type":"ui\_tab","z":"","name":"Node-red: Outliers Removal Dashboard","icon":"dashboard","disabled":false,"hidden":false}]  
file: [flows (5).json](https://discourse.nodered.org/uploads/short-url/ooiCN5kQihGHNl2j2wzXR0TiHDc.json) (1.1 KB)

---

<div class="post-metadata">

**Author:** ![Trying\_to\_learn](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/trying_to_learn/32/28400_2.png) [@Trying\_to\_learn](https://discourse.nodered.org/u/Trying_to_learn)\
**Post date:** [29 July 2023 22:09 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642/6 "2023-07-29T22:09:10Z")

</div>

Hi.

I know it is a long time since this has been active, but....

Is there an _option_ to use the code to not only put firefox (or browser) into full screen mode but to take it back to the _normal_ screen mode also?

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [30 July 2023 02:16 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642/7 "2023-07-30T02:16:52Z")

</div>

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/6/86bc0bb0c8a5cfb4e14d5c6cca7e6a58b55258c5.png)

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [30 July 2023 02:39 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642/8 "2023-07-30T02:39:56Z")

</div>

I asked _ **bard** _ to help me and this is what it gave

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/a/6ab9e15b2e0fc7ac72f231498a7ee5685391ebbd.png)

and i inserted this into a template node, and it works!

```auto
[{"id":"911e3d0e.7d6e9","type":"ui_template","z":"28a414e3a8847f5a","group":"5a956c96.cfca64","name":"","order":2,"width":0,"height":0,"format":"<script>\nvar elem = document.documentElement;\n// or overwrite value in your callback function ...\n\nthis.scope.action = function toggleFullscreen() {\n var element = document.body;\n if (document.fullscreenElement) {\n document.exitFullscreen();\n } else {\n element.requestFullscreen();\n }\n}\n\n</script>\n<md-button ng-click=\"send({payload:action()})\">\n Toggle Fullscreen\n</md-button>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","className":"","x":300,"y":180,"wires":[[]]},{"id":"5a956c96.cfca64","type":"ui_group","name":"Saving Data","tab":"f2edd282.5445a","order":3,"disp":true,"width":6,"collapse":false},{"id":"f2edd282.5445a","type":"ui_tab","name":"Node-red: Outliers Removal Dashboard","icon":"dashboard","disabled":false,"hidden":false}]

```

---

<div class="post-metadata">

**Author:** ![Marcos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcos/32/18284_2.png) [@Marcos](https://discourse.nodered.org/u/Marcos)\
**Post date:** [2 February 2024 11:16 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642/9 "2024-02-02T11:16:38Z")

</div>

Hi dears, these seem all to work properly. Any way I'm trying to go forward with another step. Imagine a kiosk mode and a keyboard on it. I use a code to enter or leave full screen and this works until I use html button. If I try to use instead a payload coming from background nodered flux, the browser doesn't switch mode because permission is denied. I tried to emulate a button click, to use payload in html page and some other attempts but no one gave me positive feedback. Of course, I can use a payload to change the colour of text on the page and some others but it seems that certain operations (like full-screen mode) are denied. Do you have any idea on how to solve this?

---

<div class="post-metadata">

**Author:** ![smanjunath211](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/smanjunath211/32/95742_2.png) [@smanjunath211](https://discourse.nodered.org/u/smanjunath211)\
**Post date:** [2 February 2024 11:45 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642/10 "2024-02-02T11:45:52Z")

</div>

> [@Marcos](#):
>
> leave full screen

how does that work, I am not an expert, but Kiosk Mode means you cannot leave fullscreen.

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/7/5/75f97e277e57cbc498e663b0f333abe37d02e52e.png)

---

<div class="post-metadata">

**Author:** ![Marcos](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/marcos/32/18284_2.png) [@Marcos](https://discourse.nodered.org/u/Marcos)\
**Post date:** [2 February 2024 12:06 UTC](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642/11 "2024-02-02T12:06:53Z")

</div>

Yes, you are right. I'm sorry. I was probably inappropriate talking about kiosk mode. I'll try to be clearer. If you use a full-screen mode and you don't have a keyboard/mouse or a virtual keyboard on a touch screen, you can not leave full-screen mode if you don't have the chance to push F11 button. So it is something similar to a "kiosk". Of course, as a maintainer (not a standard user) I would like to have the chance to leave full-screen mode. this is why I use an HTML button and a cell where insert a specific code. Well, this is pretty good but using node-red I would like to use a specific payload coming from the background but browsers (chrome, firefox) deny me.
