Seamless play and keystroke combination

jellis5612
jellis5612 Community Member Posts: 4
I'm trying to use normal javascript keystroke combinations (in this case alt + q).  Works like normal but when published for "seamless play", it won't work.  Even if I use the built in keystroke action (for a single key) in Lectora and seamless play, keystrokes aren't getting picked up.  Why is this happening?

Comments

  • timk
    timk Community Member Posts: 1,239 ✭ Legend ✭
    Try Run javascript:
    getDisplayWindow().onkeydown = function(e){
    if (e.keyCode == 81 && e.altKey){
    alert("Alt + q");
    }
    }

    If Lectora's own actions aren't working the code is slightly different:

    <a href="https://trivantis.com/support-help">Submit Bug Report</a>
  • wheels
    wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 685 eLearning ROCKSTAR Admin Team
    We went back and tested this and an On Key triggered action for Alt+Q is working for us with publish to seamless play enabled.  Please post an example title or let us know the specifics of what your publish type and options are, and how you are delivering the course and what browser you are using.  This should work so we are very interested to see why it is not!  Thank you for reporting it ....
  • jellis5612
    jellis5612 Community Member Posts: 4
    Using an external js file with

    window.addEventListener('keydown', function (e) {
    if (e.altKey && e.keyCode == 81) {
    alert("alt q")
    }
    });

    Using the above solution with getDisplayWindow() works for me when publishing for seamless play so I'm just going wilth that.  But just messing around more, something else strange happens.  Used the key trigger action and for whever reason, it started to work...kind of.  Just published without seamless play and if I did the key trigger action first (just using the letter "w"), it'd work and then if I used the alt q from the external js file, that would work.  But when go and try to use "w" key again, then the keystroke wouldn't be picked up.  The alt q continued to work.  This is probably a very unlikely scenario anyone would experience so it probably doesn't matter too much.
  • timk
    timk Community Member Posts: 1,239 ✭ Legend ✭
    How do you use an On Key Lectora action to be triggered on Alt + Q? I can select one key only, Alt is not accepted.
  • wheels
    wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 685 eLearning ROCKSTAR Admin Team
    Sorry it's a Keystroke action only available on a page, click into the next key typed trigger and then hold the alt key before pressing the Q key...

    I see in Lectora Desktop you can't do this, I'll write up a bug on this.  It works in Lectora Online.
  • timk
    timk Community Member Posts: 1,239 ✭ Legend ✭
    ... but thanks for the explanations how to press two keys at once, might be helpful from time to time ;-)
  • wheels
    wheels Community Member, Administrator, Moderator, Rockstar Manager Posts: 685 eLearning ROCKSTAR Admin Team
    Yeah it took me a while to figure it out, anything more than Ctrl+C and Ctrl+V is a struggle for me! Heh heh.
  • msullivan3430
    msullivan3430 Community Member Posts: 42
    I'm trying to use a keystroke combination with an Alt+O, but am having no luck. I've tried both seamless and not, but whenever I place my cursor in the field for the trigger and then press Alt it doesn't work. I get what is shown in the attached image file.

    Oddly enough, when I try another combination Alt+A, I get different results (see second image) ==> a smiley face?

    Both actions were placed at the page level.

    This is Lectora PUBLISHER v18.0.2 — we had to buy the stripped down version of the software to pass corporate security requirements.
  • carlfink
    carlfink Community Member Posts: 1,099 ✭ Legend ✭
    @Maura T. Sullivan, Joe Wieloch of Trivantis posted above that this did not work (last Summer) in the desktop version of Lectora. One wonders if they ever got around to adding it.