We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.

Disable keyboard input while animation is still playing

Home Forums Programming Disable keyboard input while animation is still playing

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #22661
    samuraijkm
    Customer

    Can anyone tell me if it’s possible to disable keyboard input while an animation is playing through puzzles / code ?

    I have a model which animates into an exploded view after a user clicks a button which also puts the browser into full screen mode. When exiting full screen mode the model collapses back together normally playing the animation in reverse.

    There is a buggy effect if the user hits the escape key too quickly (exiting full screen mode) while the model is still animating.

    I would like to lock all keyboard input until after the model is done animating. I tried to call these Javascript functions I found online thru the call JS function puzzle –

    function disable() {
    document.onkeydown = function () {
    return false;
    }
    }

    function enable() {
    document.onkeydown = function () {
    return true;
    }

    but it seems not to be doing anything. :wacko:

    #22664

    Hi,

    I’m afraid we do not have control over fullscreen mode. The browsers do not allow for disabling the ESC key as it would be considered a security issue. Also, there is no fullscreen feature in Safari yet.

    I’d suggest that instead of the fullscreen feature which depends on system browser window, you just expand the canvas to the maximum dimensions allowed by the HTML document.

    Chief 3D Verger | LinkedIn | Twitter

    #22704
    samuraijkm
    Customer

    Thanks for the advice Yuri,

    Unfortunately, the HTML is being housed in a CMS system which I’m unable to affect the size of the container width/height when not in full screen mode. I fixed it to reset the animation to the start when exiting full screen instead of animating in reverse. It’s not the most elegant way to do it but it fixed the buggy look. :)

    -Jason

    #22710

    :good:

    Chief 3D Verger | LinkedIn | Twitter

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.