sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    OnKeyDown not working when Web dlg is focuse...why?

    Scheduled Pinned Locked Moved Developers' Forum
    6 Posts 4 Posters 379 Views 4 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.
    • renderizaR Offline
      renderiza
      last edited by

      Hi,

      I was wondering what some of you do in a situation where because the web dlg is focuse the onKeyDown function does not work. Maybe use both javascript keys when web dlg is focused and onKeyDown when web dlg is not focused at the same time?

      Maybe in the future SketchUp should support onKeyDown with web dlg focused?...I am not sure.

      cheers! πŸ‘

      [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

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

        You mean the Tool event doesn't respond when WebDialog is focused?

        It's something which is inherit in the design of the OS. The active window is the one that receives the key-strokes.

        However, I do wish it was possible to make WebDialog act like floating toolbar-windows which returns focus to the main SU window.

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

        1 Reply Last reply Reply Quote 0
        • renderizaR Offline
          renderiza
          last edited by

          @thomthom said:

          However, I do wish it was possible to make WebDialog act like floating toolbar-windows which returns focus to the main SU window.

          Very good idea!

          [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

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

            Perhaps in your html
            <element onkeypress="window.blur">
            the 'element' would typically be 'body' ?
            You can use/choose:
            onkeydown onkeypress onkeyup
            You could of course write a customized js to run 'onkeypress=' instead and that could do 'window.blur' IF the 'key-press' returned specific values, or other actions otherwise... event.keyCode return sthe UTF key-code - I think πŸ˜•
            Have a play around...

            TIG

            1 Reply Last reply Reply Quote 0
            • renderizaR Offline
              renderiza
              last edited by

              Thanks TIG I will try that eventually.

              [url=https://www.sketchupcode.com/:z3kqsidd]My Extensions ...[/url:z3kqsidd]

              1 Reply Last reply Reply Quote 0
              • D Offline
                driven
                last edited by

                some reading http://unixpapa.com/js/key.html
                it's title
                JavaScript Madness: Keyboard Events

                trying to get my head around it at the moment...

                learn from the mistakes of others, you may not live long enough to make them all yourself...

                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