Events handling

Following some ideas about GB3 events system, how I've tried to solve some issues and the inner complexity.

The problem

As many programs GB3 waits about user commands. And most of paint commands are given by devices like keyboard, mouse and tools on tablets. These devices reports to the system various physical states (positions, pressure, angles, pressed, released, …). Most of the time the program doesn't ask these states, but waits that the system reports theirs changes.

We call that Events.

Now the complexity comes from following points:

  1. devices report many physicals states in different ways: when you press a keyboard, only one event occures 1), but many happen for the absolute position of a pen tool on a tablet, event if the pen doens't move at all.
  2. each system reports these states in differents ways: for example one system may report the two CTRL keys (on standard 105 keys keyboard) by dinstinguish the left from the right one, but another one doesn't.
  3. some systems have the possibility to let user to setup different device configurations to change the behaviours depending on application used, and this is transparent to these last.

GB3 can't let user to specify a binding between device event and an internal command if the event is not supported by the system. Using my previous CTRL key example, GB3 should not propose a “left CTRL” and a “right CTRL” bindings on a system that doesn't make the difference between left and right CTRL keys.

So the first thing we see is the binding is system dependant.

1) well… if you don't wait too long! After the system generates periodicaly the same event to repeat the pressed key action

en/dev/gb3/events.txt · Dernière modification: 2011/08/31 22:24 par Yomgui