I want to implement an Input System. The current input system is not strong enough or easy to use so that I want to make a more powerful one.


  1. Key binding can be written in lua file. For example, “Move Horizontally” is binding to W / S. We use name to get the return value of input rather than get the return value by using W and S.
  2. Events. OnkeyDown, OnKeyUp, and more useful events.
  3. Use delegate function to bind into the getAxis functions.
  4. Caching user inputs or do key combos

How users use:

  1. When player press a certain key, a certain function should be called.
  2. Developer can create lua file to bind keys to some names like “Move Horizontally”.
  3. Some public function like
    BindKey(const char* i_axisName, MyFunc i_callBackFunc, InputType i_inputType);
    IsKeyDown(const char* i_axisName);
    GetKey(const char* i_axisName);
    GetKeyDown(const char* i_axisName);

Experiment and Challenge:

I am interested in doing delegate in c++, which makes me feel this feature is very cool. I have used both  Unity and Unreal engine and they had very different input system. When I was using them, I felt like they had their own advantages and disadvantages. I wonder which one is better in which situations and if I can make a combined version of them and figure out “Oh that’s why they designed like this!”

Some challenge may be like how to do bind multiple keys with different events in one delegate functions. What’s the best way to cache inputs? What’s the best way to map and store the Name_Keys maps?