# 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:** 1\
**Showing post:** 8

<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}]

```

---

_[View the full topic](https://discourse.nodered.org/t/sendkeys-to-enter-fullscreen/4642)._
