I have a site which uses heavy key events. For certain actions, it also opens a bootbox confirm box. The confirm box is shown over a transparent layer so all mouse click actions are not executed unless the user clicks on cancel or ok in the bootbox confirm. However I also want it that all keypress events should be disabled when the confirm box is active.
Current I have:
bootbox.confirm('blah blah'? function(yesPlease){
if(yesPlease) {
goAndClimbAVolcano();
}
});
I can wrap this confirm under a disableAllKeyPress()
and enableAllKeyPress()
but I was wondering if there is an easier way to achieve this...
Any pointers are greatly appreciated.