• Login
sketchucation logo sketchucation
  • Login
ℹ️ GoFundMe | Our friend Gus Robatto needs some help in a challenging time Learn More

Little trick to find out your desired keycode

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 2 Posters 456 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.
  • A Offline
    a4chitect
    last edited by 8 May 2008, 08:43

    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 8 May 2008, 19:43

      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
      1 / 1
      • First post
        1/2
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement