fredsa / playn

Cross platform game library for N≥4 platforms
0 stars 1 forks source link

Revamped Key handling #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Purpose of code changes on this branch:
Two big changes:

1. Added onKeyTyped which communicates the unicode character that was typed. 
This is different from the key code, which corresponds (roughly) to the key on 
the keyboard. The character has been keymapped and potentially modified.

2. Added Key enum which defines all possible logical keys. The backend 
platforms map from their own internal key code representation to PlayN's Key 
enum before reporting events.

When reviewing my code changes, please focus on:
https://github.com/threerings/playn/commit/9b48aed964fd6e52050d46b440d162d817c14
924
https://github.com/threerings/playn/commit/cc16e87e0f60ef7cc2a24d5dc96db24ea0143
21a
https://github.com/threerings/playn/commit/5925346a01c154d166e487344f9e342eef3c7
7b2

After the review, I'll merge this branch into:
/trunk

Original issue reported on code.google.com by samskiv...@gmail.com on 12 Oct 2011 at 12:07

GoogleCodeExporter commented 9 years ago
I haven't yet looked at the code, but this is a far better way of handling key 
events (instead of having a variable to handle each key on each platform) we 
can just ask if "KEY_UP" is being pressed and it will work with the respective 
keycode on every platform.

Original comment by Davidraf...@gmail.com on 12 Oct 2011 at 6:56

GoogleCodeExporter commented 9 years ago
Reviewed by way of Charlie using the new code for three weeks and not 
complaining about it.

Original comment by samskiv...@gmail.com on 2 Nov 2011 at 5:17