Skip to main content
Known Participant
December 7, 2016
Question

creating shift-click and ctrl-click buttons using javascript

  • December 7, 2016
  • 2 replies
  • 400 views

I've been trying to use javascript to create both shift-click and ctrl-click buttons (separate buttons) but they don't seem to work. Any suggestions:

Here is the code for the shift-click button:

$(document).click(

  function(e){

    if(e.shiftKey){

      document.Captivate.cpEISetValue('m_VarHandle.cpCmndNextSlide');

    }

  }

);

    This topic has been closed for replies.

    2 replies

    TLCMediaDesign
    Inspiring
    December 7, 2016

    I think even if you get the script loaded at the right time, you are going to run into issues with Captivate blocking the click for HTML5 unless you click outside of the presentation.

    Known Participant
    December 7, 2016

    I might have to stick to SWF buttons then.

    TLCMediaDesign
    Inspiring
    December 7, 2016

    Are you using CP7 and swf, html or both?

    Your syntax is a little off

    $(document).click(function( e )

           {

            if (e.shiftKey)

            {

             document.Captivate.cpEISetValue('m_VarHandle.cpCmndNextSlide');

            }

           });

    Also since you are using jQuery, you will need to load it for swf and for HTML5 you need to put the script after jQuery is loaded.

    Known Participant
    December 7, 2016

    I'm using CP8 and I wanted to use javascript instead of creating a swf button so I can also use the button for html 5. So both SWF and HTML5.