sketchucation logo sketchucation
    • 登入
    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!
    ⚠️ Important | Libfredo 15.8b introduces important bugfixes for Fredo's Extensions Update

    Web dialogs stealing focus within my tool.

    已排程 已置頂 已鎖定 已移動 Developers' Forum
    28 貼文 7 Posters 2.2k 瀏覽 7 Watching
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • Dan RathbunD 離線
      Dan Rathbun
      最後由 編輯

      It would be alot simplier if there was a UI::send_keys() module function very similar to (or wrapping) this Windows Scripting Host function:
      http://msdn.microsoft.com/en-us/library/8c6yea83(v=vs.84).aspx
      .. in fact here is a C++ implementation:
      http://www.codeproject.com/Articles/6819/SendKeys-in-C

      I'm not here much anymore.

      1 條回覆 最後回覆 回覆 引用 0
      • A 離線
        Aerilius
        最後由 編輯

        @eneroth3 said:

        In some cases the developer might not want this so it shouldn't always be enabled.

        Absolutely right!

        The event bubbling concept in the HTML DOM allows to "cancel" further bubbling, if your event listener has already "fullfilled" the event and there is nothing left that you want to happen (otherwise the next, outer event handlers would get the event and act on it). Expanding this concept from WebDialogs to the SketchUp window could be done re-use something with which developers are familiar, without adding new API methods or arguments.

        No matter how it would be realized, it would really be useful for us developers if SketchUp could incorporate this feature.

        Would it make sense to allow this for different kinds of events, or should it filter out all except keyboard events?

        1 條回覆 最後回覆 回覆 引用 0
        • Dan RathbunD 離線
          Dan Rathbun
          最後由 編輯

          @aerilius said:

          Expanding this concept from WebDialogs to the SketchUp window could be done re-use something with which developers are familiar, without adding new API methods or arguments.

          How can a feature be added, without adding some interface to the SketchUp API ? Impossible.

          There needs to be some key_bubble flag ( true by default for backward compatibility,) that the SU engine checks in Tool class instances.

          Basically the engine would do a check like:
          bubble = tool.respond_to?(:key_bubble) ? : tool.key_bubble : true

          We need to concentrate the talk on keystrokes. Other events just complicate the issue.

          I'm not here much anymore.

          1 條回覆 最後回覆 回覆 引用 0
          • tt_suT 離線
            tt_su
            最後由 編輯

            You can already return true/false in the key event to prevent some propagation.

            1 條回覆 最後回覆 回覆 引用 0
            • Dan RathbunD 離線
              Dan Rathbun
              最後由 編輯

              @tt_su said:

              You can already return true/false in the key event to prevent some propagation.

              In Ruby ?

              I'm not here much anymore.

              1 條回覆 最後回覆 回覆 引用 0
              • tt_suT 離線
                tt_su
                最後由 編輯

                Aye.
                One of them things not mentioned in the docs I think. (On our list to fix.)
                I came across it once when I noticed odd behaviour with key events and realized it depended on the return value of my last statement in the onKey events.

                1 條回覆 最後回覆 回覆 引用 0
                • eneroth3E 離線
                  eneroth3
                  最後由 編輯

                  At least on windows you can prevent ALT from focusing the menu when used in a tool. Either true or false (can't remember) as return value from the onKeyDown method prevented the default behavior.

                  My website: http://julia-christina-eneroth.se/

                  1 條回覆 最後回覆 回覆 引用 0
                  • Dan RathbunD 離線
                    Dan Rathbun
                    最後由 編輯

                    Dang it! That is news to me. Did ya'll hire someone to to be a TechWriter for the API? (Ya' need to badly.)

                    I'm not here much anymore.

                    1 條回覆 最後回覆 回覆 引用 0
                    • 1
                    • 2
                    • 2 / 2
                    • 第一個貼文
                      最後的貼文
                    Buy SketchPlus
                    Buy SUbD
                    Buy WrapR
                    Buy eBook
                    Buy Modelur
                    Buy Vertex Tools
                    Buy SketchCuisine
                    Buy FormFonts

                    Advertisement