view codeDoc/input/inputIDs.txt @ 179:1f9d00f392bd default tip

Fixed a bug where (non-resizible) widgets wouldn't get shrunk when minimal size decreases, meaning optional context menus are hiden properly now. Optimised when ServiceContentList.opCall is called, I think without breaking anything.
author Diggory Hardy <diggory.hardy@gmail.com>
date Tue, 15 Sep 2009 20:09:59 +0200
parents 611f7b9063c6
children
line wrap: on
line source

Part of mde: a Modular D game-oriented Engine
Copyright © 2007-2008 Diggory Hardy

This program is free software: you can redistribute it and/or modify it under the terms
of the GNU General Public License as published by the Free Software Foundation, either
version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.


Event input status and callbacks are differentiated via IDs of type Input.inputID (currently uint).

Multi-user support requiers some way to make these specific to particular users; this is intended to be implemented via each user having their own Input class object; user-common callbacks are added by each user's class, thus enabling these to have extra user-specific functionality added later. Thus inputIDs don't need to contain a user ID.

4 bytes are available; of this the lowest 4 bits specifies which part of the engine uses these IDs, the rest is available for the engine part to use as it wants. The reason the lowest 4 bits are used for the engine part is so that if the inputID type is changed to a different sized integer, these 4 bits remain at the end of the block (i.e. the IDs available for the subsystem are still in one block).

Bit:	31		   4  3		0
	[ engine subsystem ]  [subsystem]


Subsystem values:
0	Direct engine commands:
		Main commands handled by mde.mde (may be moved), e.g. direct quit
1	GUI/User interface:
		Interface commands, including quit dialog box
2	Physics system:
		Direct control of thrusters, etc (control also possible via scripts)
3	Scripting system:
		Indirect control of thrusters, etc. from physics objects
		Other game-world interaction & scripting uses
4-F	Unassigned


This is not enforced by the engine (except perhaps for scripts?), but simply followed.



Subsystem 0:
xx_xx_xx_00	Quitting:
00_00_00_00		End main loop normally
xx_xx_xx_E0	Debug dumps/commands
xx_xx_xx_F0	Test events




For stream functions, codes are used as follows. Only the last (lowest) two bytes are used; of this the highest 4 bits categorise the rough type of the stream function, and the next 4 bits subdivide this. The lowest byte has no meaning but is just a number.

Categorisation:

1*_**	Output as event
2*_**	Adjustments, keeping same output type
3*_**	Adjustments with a different output type
F*_**	Debug types
    *
2X_**	Adjustments:
	OR'd flags for X:
	1	uses timers
	2	uses other events from same button/axis/etc.
	4	uses other events from different button/axis/etc.
	8	no output, only sets values for use by other adjusters
    *
3X_**	Adjustments with different output types (e.g. axis -> button):
	OR'd flags as for 2X_**

F*_**	Debug outputs:
	F0_00	No output, doesn't do anything
	F1_**	Logs output, passing event on

Actual codes, with config values used:

1000	Standard output functions
		Use 1 config value for output ID
2000	Reverse value (axes only)
		No config values