Difference between revisions of "User:Seldon/GSoC2007-ProjectDiary"

Jump to navigation Jump to search
key mapping improvements architecture
m
(key mapping improvements architecture)
Line 72: Line 72:
So, key mapping is used to convert key codes to other key codes which in turn are mapped to certain game actions. Key mapping takes place in the pollEvent functions of the backend OSystem classes. The actual device specific mapping is done through the Actions classes like CEActionsSmartphone. Currently only wince supports user key mapping dialogs.
So, key mapping is used to convert key codes to other key codes which in turn are mapped to certain game actions. Key mapping takes place in the pollEvent functions of the backend OSystem classes. The actual device specific mapping is done through the Actions classes like CEActionsSmartphone. Currently only wince supports user key mapping dialogs.
In general key mapping is implemeted in wince, symbian, ds, and palm backends. Wince and symbian provide the best implementations.
In general key mapping is implemeted in wince, symbian, ds, and palm backends. Wince and symbian provide the best implementations.
== 2007-07-08 (Monday) - new key mapping architecture ==
Today I had a long conversation with sev on the phone. We have decided that the best idea would be to extend and implement the Max's proposal on [[Keymapping Improvements]]. Here is the plan:
* according to Max, we introduce new type of events called UserActions;
* UserActions represent engine specific actions like quit, pause, etc., and game specific actions like move left, right, jump, etc.
* each backend has its own event manager which is aware of all device buttons;
* each engine provides the event manager with all the actions it and the currently selected game needs;
* event managers are responsible for mapping the key codes to specific actions (there are default and custom/user mappings);
* the event manager's pollEvent function will now return the UserAction (it will also fill the event structure for the time being for backwards compatibility)
* UserAction class will still have the keyCode field because some engines do check key codes to do smth and some engines also require user text input;
69

edits

Navigation menu