You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Haxe
I'm trying to capture some keyboard input, but I'm not sure how I can go about it.
I would like to bind certain functions to key presses - e.g. [Esc] to cancel when on certain screens in my app.
I'm using HaxeUI, so as far as I know, I don't have a Flash stage I can use to do this. Is there any way to hook the keys and do something with the presses?
Juraj Kirchheim
unread,
Sep 22, 2015, 1:14:02 AM9/22/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Haxe
Yeah, "DisplayObject.root" would do it, and if you arent using mulitple roots, you could use "RootManager.instance.currentRoot", or if you are "RootManager.instance.roots[n]". You do have access to the underlying sprite also, so you could also do "DisplayObject.sprite.stage", and a root is just a display object so "RootManager.instance.currentRoot.sprite.stage" would also work. :)
Or you could just use "openfl.Lib.current.stage"... heh heh.
Cheers,
Ian
Will Maynard
unread,
Sep 25, 2015, 3:21:41 PM9/25/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Haxe
Thanks, Ian!
openfl.Lib.current.stage did the trick.
I actually tried using Lib.current.stage (without openfl) last week with no success, but with how much the code has changed since then, I can't really compare what exactly is different now.