• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

How to use animation (nextFrame) when key pressed?

Scheduled Pinned Locked Moved Developers' Forum
3 Posts 2 Posters 8.4k Views
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.
  • P Offline
    Pixero
    last edited by 24 Jun 2019, 07:01

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

    1 Reply Last reply Reply Quote 0
    • F Offline
      fredo6
      last edited by 25 Jun 2019, 16:37

      @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
      • P Offline
        Pixero
        last edited by 25 Jun 2019, 18:55

        Thanks. Ill try that.

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

        Advertisement