Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong key code? #95

Closed
ghost opened this issue Mar 1, 2014 · 3 comments
Closed

Wrong key code? #95

ghost opened this issue Mar 1, 2014 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 1, 2014

Lime and Openfl both return 1073741907 for cpp/windows while other os/target combinations return 144.

This might be related: http://wiki.libsdl.org/SDLKeycodeLookup

I think Openfl uses SDL to get the keycode wich uses numbers over 1073741824 for keys without character representations.
Openfl is a implemention of the flash api so it should probably return keycodes similar to how flash does it .

Causes a crash in HaxePunk: HaxePunk/HaxePunk#243

@Gama11
Copy link
Member

Gama11 commented Mar 2, 2014

Related: openfl/openfl-native#193

@ibilon ibilon mentioned this issue Mar 10, 2014
@Draknek
Copy link

Draknek commented Jan 12, 2015

This is still an issue as of the most recent git version of lime. Function keys are mapped incorrectly, e.g. F4 sends the keycode for "S".

Full list of incorrect keycodes here: openfl/openfl-native#193

I don't know why openfl/openfl-native#199 was closed, it claims to fix this? (cc @jgranick)

@jgranick
Copy link
Member

jgranick commented Feb 20, 2015

There is still more work that could be done on consistency, but I just tested a simple onKeyDown handler in Lime, and yes, it does return high values for F1-F12, but this matches the same values in the lime.ui.KeyCode enum, so trace (keyCode == KeyCode.F1) is true.

Similarly, OpenFL appears to be handling things based on the Lime KeyCode enum, so it maps Lime F1 keys to Flash/OpenFL F1 key codes.

I'm going to mark this as "fixed" again based on what I'm finding. Please feel free to let me know if you encounter a case where it is wrong, and which path (legacy or Lime 2) it is on, etc.

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants