Skip to main content
Participating Frequently
Jan 5, 2021 9:11 PM UTC
Question

Disable Browser's Ctrl+S Functionality

Using Captivate 11.5/Windows, is there a script or some other option that will disable a browser's Ctrl+S function when viewing a project? The scenario is saving a document in MS Word and allowing the learner to use any method of saving the document (Save button on the QAT, File>Save/Save As, or Ctrl+S). Any help would be muchly appreciated!

This topic is closed to new replies. Start a new post to keep the conversation going.

4 replies

OH_CP_Lover_&_Hacker
Inspiring
Feb 8, 2021 11:01 PM UTC

Hello,
The following JS code has worked for me in the past to disable Control/Command + S for me in the past while a Captivate project is running:

$(window).bind('keydown', function(event) {
    if (event.ctrlKey || event.metaKey) {
        switch (String.fromCharCode(event.which).toLowerCase()) {
        case 's':
            event.preventDefault();
            alert("Control/Command + S is not allowed.");
            break;
        default:
            break;
        }
    }
});

 

You can easily add other letter keys  by adding more case statements.

 

Hope this helps you out a bit.

Translate
OH_CP_Lover_&_Hacker
Inspiring
Jun 17, 2022 2:32 PM UTC

Hello there, I was  wanting to know if my solution worked for you?  I hope my message finds yo and your family doing well!

Translate
Eric Dumas
Community Expert
Community Expert
Jan 6, 2021 9:51 AM UTC

Hi,

Can you clarify the learner's interactions?

Are you simulating MS Word and you want the learner to practice/demonstrate that they can save the document in different ways?

I am not clear about the relationship between Word and browser.

Translate
Participating Frequently
Feb 8, 2021 5:09 PM UTC

Thanks for responding, Eric. Let me clarify.

 

The "Save a Word File" project includes a click box for Ctrl+S, packaged as SCORM (HTLM5), and published to an LMS. The learner is viewing the project in the browser of their choice from the LMS. Pressing Ctrl+S as the learner is instructed on the appropriate slide invokes the Save As dialog box for the browser in use, not the control configured with the click box (Ctrl+S).

 

I was hoping that we could use JavaScript to temporarily disable the Ctrl+S function of a browser. Unfortunately, Captivate's JavaScript support is extremely limited. If you have any other ideas, I'm open to them.

Translate