OnKeyDown not working when Web dlg is focuse...why?
-
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!
-
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.
-
@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!
-
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... -
Thanks TIG I will try that eventually.
-
some reading http://unixpapa.com/js/key.html
it's title
JavaScript Madness: Keyboard Eventstrying to get my head around it at the moment...
Advertisement