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

    Override the alt-key in a class ??

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 3 Posters 264 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.
    • artmusicstudioA Offline
      artmusicstudio
      last edited by

      hi,

      within my own class (tool) i use shift, ctrl and alt for alternative mouse functions.

      is it possible to override the native alt-function (menu-hi-lite) temporarily within a tool

      and set it back , when the tool is finished?

      i canot find any topic about this ....

      thanx
      stan

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

        The %(#000000)[alt] key is often operating-system-reserved, and provides functions. If applications stay in their own field, there shouldn't be conflicts (or confusion of users).

        There are no special API methods for enabling/disabling. Some API methods can be used for to override default behaviour (inside the application), like onMButtonDown (default: orbit), onRButtonDown (default: application context menu).
        But have you tried pressing %(#000000)[alt]+ %(#000000)[altgr] ?
        A good alternative to overloading a tool with multiple modes is to just make several tools, and intuitive icons that make it easy to switch.

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

          @artmusicstudio said:

          is it possible to override the native alt-function (menu-hi-lite) temporarily within a tool

          This is possible for ALT.
          You need to return true in the onKeyUp method for the case of key == ALT_MODIFIER_KEY.

          Actually, returning true seems to prevent bubbling. This is also a way to prevent characters to go to the VCB

          Fredo

          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