Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changes between Initial Version and Version 1 of code/doc/KeyBinder


Ignore:
Timestamp:
Sep 17, 2008, 9:09:15 AM (16 years ago)
Author:
rgrieder
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • code/doc/KeyBinder

    v1 v1  
     1= KeyBinder =
     2
     3== Concepts ==
     4When creating the concept for input processing, we were left with two possibilities. The first and simpler one was to have an ID for every possible event. When you press a key, that event is fired and all listeners get informed. But as my colleague pointed out, this doesn't really scale since you have add new events over and over. [[br]]
     5Instead he suggested to write a command interpreter that would parse a string and execute a command ([wiki:CommandExecutor]). Consequently this simplifies the KeyBinder by magnitudes: Every key can be assigned a string and whenever you press the key, the string gets executed. The obvious disadvantage is performance, but that has been dealt with preparsing so that the overhead gets minmal.
     6
     7== A quick how to ==
     8There is a built in [wiki:ConsoleCommand] named "keybind" which helps you assign the keys. Write 'keybind' followed by an arbitrary ConsoleCommand with arguments, hit enter and press the key you would like to assign it to. This also works for mouse and joystick axes. However you have to do some double work since those axes are split in half ones. For simple left-right movement for instance, this means you have to assign left movement to the left axis and vice versa.
     9
     10== Internals ==