I have a form I want to submit when the user presses CTRL+S.
In the submit button of the form I have the dmx-on:keydown.ctrl.keys line, but I can’t seem to make it activate… am I missing something about how this works, or something that could stop it activating?
Using dmx-on:keydown.ctrl.keys="f_message_template.submit()" makes no sense in the button like that.
What do you want to achieve exactly? To submit the server connect form on pressing Ctrl+s on this page?
First of all you need to bind this on the page body (App root) not on the form or the button as it makes no sense to use it there, and then you have to prevent the default browser ctrl+s behavior, which is to save your html page locally on your computer.
So select App, add a dynamic event on key down, and select modifiers - Ctrl, Key S and Prevent:
Brilliant @teodor, that is working great! Thank you so much.
It has raised another question though. I really wanted this function when a user has gone into full screen mode and wants to make intermediate saves while editing a long document.
The crtl-S is now doing the .submit() function, but it is also closing the full screen window. Do you know how I can prevent this happening? I've had a quick google of this for summernote but can't see anything obvious to try!
But when in this mode, if the user does crtl-S, then their edits are saved but the full screen mode is exited. I really want them just to stay in full screen mode the whole time!