Hi devs!
Is there a way to make SketchUp shortcuts work when WebDialog is open?
In SketchUp 2016 if I have focus on my plugin WebDialog shortcuts are not working but if I click the SketchUp main window (where the model is build) they work.
Is there a quick way to propagate the shortcuts thru webdialog?
Andrei, correct me if I am wrong, but from your description it sounds like the opposite situation from what John describes. Namely, when the WD has focus it receives all keyboard input, including keys that you have set as shortcuts in SketchUp. You are asking for clues about javascript and ruby code that would propagate those keys through to SketchUp? I’ll let more expert voices chime it, but I don’t think this is possible without reimplementing the actions of the shortcuts in ruby. Shortcuts are a feature of the SketchUp GUI, which is inactive when a WD has focus or ruby is running.
In the original v16 there was a bug where the webdialogs were loosing focus to SU. This was very annoying when SU was firing away (short-cut) commands when you were inputting some text fields in the webdialog. The only way to fix that was adding a ‘focus’ command in javascript.
So, maybe you can add some ‘blur’ and ‘focus’ commands to your javascript to make it work?!
My WD comunicates with nodejs server, if WD receives a message I lose focus from SketchUp and the shortcuts are not working until I click again on SketchUp.
I think I found the issue, after every message received by WD I resize it which cause change of focus.
The fix will be to set focus to SketchUp after WD resize.