I'm trying to convert some Flex code to Royale. In particular, I'd like to
add a keyDown listener to a component in MXML so I can listen to special
keys like Esc, but there doesn't seem to be any [Event] metadata for
keyboard events on UIBase. I see that there is [Event] metadata for mouse
events, though.

Maybe I've missed it, but there also doesn't even seem to be a bead that
can somehow allow me to add a keyDown listener in MXML either. I found
DispatchKeyboardEventBead, but it seems to dispatch the event on the
strand, which would require me to manually call addEventListener() in AS3
instead, which is pretty complicated because I would need to listen to some
other event in MXML first, like initialize or whatever.

Both mouse and keyboard feel to me like pretty fundamental forms of user
input. With that in mind, if PAYG is the justification for not exposing
keyboard events, I'm not sure how the same justification doesn't apply to
mouse events. On the other hand, if it's something that actually should be
exposed without beads, and it simply hasn't been a priority yet, then I
hope someone can help me add it. I tried my best to figure out how Royale
MouseEvents get converted from HTML/JS mouse events, to see if I could do
something similar with keyboard events, but it wasn't clear to me where the
lowest level listeners were being added for things like
mousedown/mouseup/mousemove/etc.

--
Josh Tynjala
Bowler Hat LLC <https://bowlerhat.dev>

Reply via email to