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

    Little trick to find out your desired keycode

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 456 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.
    • A Offline
      a4chitect
      last edited by

      prints the code to the ruby console

      class KeysTool 
      def onKeyDown(key, rpt, flags, view)
      puts "key; " + key.to_s + ", repeat; " + rpt.to_s + ", flags; " + flags.to_s
      end
      end
      Sketchup.active_model.select_tool KeysTool.new
      

      paste the above code into webconsole, execute
      after that focus from the webconsole to sketchup and pressing keyboard prints respective codes to the console

      1 Reply Last reply Reply Quote 0
      • A Offline
        a4chitect
        last edited by

        no, sorry for causing confusion. this is only helpful when developing tool plugins and you want to use keyboard to control your tool behavior, you need a code of each key so that you can specify what to look for. these codes are nowhere to be found (su ruby api) so only way I found is to run the key discovery tool posted above and pressing keyboard print respective codes to the ruby console.

        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