Sendkeys to enter fullscreen

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) :slight_smile:

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

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

Perfect - that works :slight_smile: Thanks

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

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 (1.1 KB)

2 Likes

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?

image

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

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

[{"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}]

2 Likes

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?

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

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.