while everything is fine in Java, in JavaScript I get a sys::NullErr: Coerce to non-null as it seems the fwt::Event#keyChar is not set, even though fwt::Widget#onKeyDown says it should be.
andyThu 26 Jul 2012
Event.keyChar is not very reliable in the browser. I recommend you use Event.key and use the built-in Key constants.
SlimerDudeThu 26 Jul 2012
Yeah, that's what I did. But if Event.keyChar is not set in JS, could it not be reflected in the docs?
Or maybe replace it with a Key.keyChar method which throws an sys::UnsupportedErr in JS?
SlimerDude Wed 25 Jul 2012
If I add the following to a Widget (specifically a fwt::Canvas)
onKeyDown.add |Event event| { chr := event.keyChar.toChar }while everything is fine in Java, in JavaScript I get a
sys::NullErr: Coerce to non-nullas it seems the fwt::Event#keyChar is not set, even though fwt::Widget#onKeyDown says it should be.andy Thu 26 Jul 2012
Event.keyCharis not very reliable in the browser. I recommend you useEvent.keyand use the built-in Key constants.SlimerDude Thu 26 Jul 2012
Yeah, that's what I did. But if
Event.keyCharis not set in JS, could it not be reflected in the docs?Or maybe replace it with a
Key.keyCharmethod which throws ansys::UnsupportedErrin JS?