IInput: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
'''<code>IInput</code>''' is a client [[interface]] that packages user input from keyboards, mice and joysticks/gamepads into [[usercmd]]s for transmission to the server. It also handles [[third-person camera]]s.
'''<code>IInput</code>''' is a client [[interface]] that packages user input from keyboards, mice and joysticks/gamepads into [[usercmd]]s for transmission to the server. It also handles [[third-person camera]]s.
Conventionally, each type of supported peripheral has its own CPP file. Valve's <code>[[CInput]]</code> interface implementation is in <code>in_main.cpp</code> (for keyboard and usercmd packaging), <code>in_mouse.cpp</code> and <code>in_joystick.cpp</code>.


== Implementation ==
== Implementation ==

Revision as of 10:12, 3 August 2009

IInput is a client interface that packages user input from keyboards, mice and joysticks/gamepads into usercmds for transmission to the server. It also handles third-person cameras.

Conventionally, each type of supported peripheral has its own CPP file. Valve's CInput interface implementation is in in_main.cpp (for keyboard and usercmd packaging), in_mouse.cpp and in_joystick.cpp.

Implementation

class CMyInput : public CInput
{
};

// For mod access
static CMyInput g_Input;

// For engine access
IInput* input = (IInput*)&g_Input;

See also

  • CInput, Valve's basic IInput implementation