sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Tools and keys pressed

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 331 Views 3 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.
    • thomthomT Offline
      thomthom
      last edited by

      I got a tool where the VCB is enabled.

      If I activate it an type "s" or "e" then I activate the Scale or Eraser tool.
      But if I type a digit first, then subsequent "s" or "e" won't trigger their tools. ("5sesesesese" <- this does not trigger any tools)

      On the other hand, if I type "5f" then the Offset tool wil trigger when I type "f" - even though I typed a digit first. Inconsistent with Scale or Erase.

      Can anyone explain this?

      Also, is there any way to suppress keys being pressed when your tools is activated to trigger other tools?

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • F Offline
        flyashy
        last edited by

        erm..
        could be that the vcb considers the 's' in 5s as segments and thus does not consider the following keypresses? i don't know about the 'e' though..

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          All numbers, points, commas and brackets etc and the characters s, x and / are 'protected' characters. The last three when used after numbers 'always', and when used before numbers IF you have NOT redefined them to a Shortcut key - e.g. using x for xray-mode would NOT be a good idea as Move+Ctrl copy x5 will turn on xray mode, whereas 5x arrays the copy 5 times. These last three characters are used in setting arc segments and array copying. Incidentally you could set 2 to be a Shortcut key BUT every time you pressed 2 as part of a length in the VCB the Shortcut-Tool would trigger - therefore some keys should never be used for Shortcuts!
          Thus if you use one of these 'protected' characters in your Tool's VCB text they are ignored, especially if they are after a number.
          If you use m, cm, mm, ", ' after numbers then these too are ignored as Shortcuts as they could be lengths.
          Otherwise typing 2m wouldn't be taken as 2 meters but Move which would make life impossible !
          All other character are read as VCB commands if they are anywhere in the VCB text!
          For example, use the Line tool and type in 3m or 3cm or 3mm and you gets lines of those lengths; also typing 3' gives a 3foot long line, or 3" gives a 3inch long line: BUT typing 3ft jumps out of Line to Followme then Tapemeasure [OR whatever your shortcuts are set to] and 3in doesn't work for inches either!

          So to recap you can only safely accept certain characters in the VCB AFTER numbers as the user might have [ill-advisedly] remapped some like x or s to shortcut to other tools. These characters are s, x, /, ', ", m, c[m], m[m] and , as separators - I have also safely used a : as a separator in my 2D Chamfer tool. The text 'pt' and <> brackets are also potentially allowed to set relative co-ordinates - for example, to set the end point to a location 1.5 points right and 2.3 points down from the start point, type <1.5pt,2.3pt>. For polar ^ is potentially allowed as a start character thus ^45,10m for 45 degrees,10m. To set absolute co-ordinates from the ORIGIN you can also use [10",2"] so square brackets [] are also potentially allowed ?

          I don't think you can 'switch off' the VCB character recognition, IF you want to use it to take lengths etc, BUT you can switch of the VCB completely, with this def, within your Tool using

          def enableVCB?
            return false
          end### or return true to switch it on
          

          You can then watch for user key-presses [Tool.onKeyDown or Tool.onKeyUp] within your own Tool without risk of the VCB taking something the wrong way... πŸ˜•

          TIG

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            "degree" seem to work as input as well.

            @tig said:

            I don't think you can 'switch off' the VCB character recognition, IF you want to use it to take lengths etc, BUT you can switch of the VCB completely, with this def, within your Tool using

            Off is the default.

            @tig said:

            You can then watch for user key-presses [Tool.onKeyDown or Tool.onKeyUp] within your own Tool without risk of the VCB taking something the wrong way... πŸ˜•

            Problem is that the shortcuts still trigger.
            I was enabling the VCB in hopes it'd prevent that and catch the keys... πŸ˜•

            I've even tried returning false on the Key events - in hopes to suppress the keys being sent to the rest of the system - like you do in HTML + Javascript. But no luck there either.

            Bugrit, millennium hand an' shrimp!

            Anther idea crash and burns. 😞

            Thomas Thomassen β€” SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            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