sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    How to use animation (nextFrame) when key pressed?

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 8.4k Views 2 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • PixeroP Offline
      Pixero
      last edited by

      Is there a simple example of how to use animation (nextFrame) for continous key pressed action?

      1 Reply Last reply Reply Quote 0
      • fredo6F Offline
        fredo6
        last edited by

        @pixero said:

        Is there a simple example of how to use animation (nextFrame) for continous key pressed action?

        You need to use a timer and stop it when the key is released. Possibly, you can increment the change rate by counting the timer hits to give some kind of acceleration is the arrow down are maintained for long. All this works very well and I use this approach in some of my plugins (ThruPaint for instance)..

        Note that you cannot rely on the repeat feature of Sketchup Tool onKeyDown() callback, because it does not work reliably.

        1 Reply Last reply Reply Quote 0
        • PixeroP Offline
          Pixero
          last edited by

          Thanks. Ill try that.

          1 Reply Last reply Reply Quote 0
          • 1 / 1
          • First post
            Last post
          Buy SketchPlus
          Buy SUbD
          Buy WrapR
          Buy eBook
          Buy Modelur
          Buy Vertex Tools
          Buy SketchCuisine
          Buy FormFonts

          Advertisement