Modifier keys, inputbox, and onKeyDown events on Mac

I wanted to use the control and option/alt keys on a Mac to toggle modes of a Tool I am developing. I trapped the keycodes in the Tool’s onKeyDown event and processed them. This worked well until I opened a UI.inputbox within the control key processing in onKeyDown. When I do that, the next press of either the control or option/alt key does not cause any event to be seen. It takes a double-tap to get an event. Then all is well again until the next time the inputbox is opened.

The attached Ruby demonstrates this behavior (it adds an Extensions menu item named onKeyDownTest to activate the Tool. The issue occurs on both SU 2016 and 2015 as well as on every release of OS X I have accessible to test. It does not happen on Windows (where I use tab instead of option/alt because alt is bound by the system to select a menu).

onkeytest.rb (1020 Bytes)

This feels like a subtle bug, but I want others verify that this glitch happens on their Macs (and does not happen on Windows) before reporting it.

I also get the pregnant pause…

because the dialog is modal you may need a ‘suspend’/‘resume’ either side of it, or just use a webDialog…

john

I don’t understand…these are events sent by SketchUp to a Tool when another tool temporarily interrupts it.

Was considering that, but since this seems like a bug I thought I’d discuss it here anyway.

I’ve never used them, but was just speculating that they may also work with the ‘modal’ interrupt…

I only use dialogs when I want to break the flow, as that seems to be their primary ‘plus’ feature…

but I agree this looks like a bug…

john