We’re just finishing up a large OpenFL based project and (as ever when you’re up against it) I suddenly realised we need some way of detecting soft keyboard dismissal for iOS and Android since we have totally custom textFields (sigh, don’t ask) that need to respond appropriately.
AS3 supports SoftKeyboardEvent.SOFT_KEYBOARD_ACTIVATE etc. so I added this functionality to legacy (which we’re using for our first version) which proved pretty trivial thankfully. So everything’s fine at that end.
However, for the sake of completeness I thought it might be an idea to add it to the current (non-legacy) version and so had a poke around though the code (which is looking really nicely put together structurally, great job there). I could just jump in but I thought perhaps it might be an idea to ask advice as to the right approach here (@singmajesty etc.) before wading in and wasting everyone’s time:
On the Lime side of things, would it make sense to create a SoftKeyboardEvent class in the style of JoystickEvent etc. and then have a lime_soft_keyboard_event_manager_register type function which registers a callback as you do for the various other events? Then trigger SoftKeyboardEvent::Dispatch from the appropriate application class? It seems bit of overkill to create a whole new type of Event for something like this, but it doesn’t seem to fit anywhere else and it seems to fit with the general scheme.
Then over in OpenFL I presume you’d have some sort of onSoftKeyboardActivate/Deactivate function in Stage that can then do the business of generating the flash style event and sending it on its way. Does that make sense? Or am I barking up the wrong tree?