• Login
sketchucation logo sketchucation
  • Login
ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

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.
  • R Offline
    renderiza
    last edited by 29 Apr 2013, 10:04

    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
    • T Offline
      thomthom
      last edited by 29 Apr 2013, 10:07

      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
      • R Offline
        renderiza
        last edited by 29 Apr 2013, 10:11

        @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
        • T Offline
          TIG Moderator
          last edited by 29 Apr 2013, 10:59

          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
          • R Offline
            renderiza
            last edited by 29 Apr 2013, 12:31

            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 3 May 2013, 20:14

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

              Advertisement