Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

creating shift-click and ctrl-click buttons using javascript

Community Beginner ,
Dec 07, 2016 Dec 07, 2016

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');

    }

  }

);

374
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Dec 07, 2016 Dec 07, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 07, 2016 Dec 07, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Dec 07, 2016 Dec 07, 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Dec 07, 2016 Dec 07, 2016
LATEST

I might have to stick to SWF buttons then.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Help resources