I am trying to prevent the user from closing the Electron application. In my case user is using Alt + spacebar combination and by doing so a menu will appear in which we have a close option. Please refer the image attached with comment.
I want to disable Alt + spacebar option, if that is not possible, I want to disable close option in the popup menu.
I tried following code, but it is not working for me:
`if ((input.alt && input.code === ‘Space’) || (input.alt && input.key === ‘ ‘)) {
event.preventDefault();
}
if ((input.key === ‘Alt’ && input.code === ‘Space’) || (input.key === ‘Alt’ && input.key === ‘ ‘)) {
event.preventDefault();
}`
Shrikant Binorkar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.