PixelLightAPI  .
Public Member Functions | Static Public Member Functions | Public Attributes
PLInput::InputManager Class Reference

Input manager. More...

#include <InputManager.h>

List of all members.

Public Member Functions

PLINPUT_API void Update ()
 Update input manager once per frame.
PLINPUT_API void DetectDevices (bool bReset=false)
 Detect devices.
PLINPUT_API const PLCore::List
< Provider * > & 
GetProviders () const
 Get list of input providers.
PLINPUT_API PLCore::List
< Provider * > & 
GetProviders ()
 Get list of detected input providers.
PLINPUT_API ProviderGetProvider (const PLCore::String &sProvider)
 Get a specific input provider.
PLINPUT_API PLCore::List
< Device * > & 
GetDevices ()
 Get list of devices.
PLINPUT_API DeviceGetDevice (const PLCore::String &sDevice) const
 Get a specific device.
PLINPUT_API KeyboardGetKeyboard () const
 Get default keyboard device.
PLINPUT_API MouseGetMouse () const
 Get default mouse device.

Static Public Member Functions

static PLINPUT_API InputManagerGetInstance ()
static PLINPUT_API bool HasInstance ()

Public Attributes

PLCore::Event< bool > EventOnDetectDevices
PLCore::Event< Controller
*, PLCore::String
EventInputControllerFound

Detailed Description

Input manager.

Remarks:
The input manager stores all available devices that are present on the computer and controls the update of input messages.

Member Function Documentation

static PLINPUT_API InputManager* PLInput::InputManager::GetInstance ( ) [static]
static PLINPUT_API bool PLInput::InputManager::HasInstance ( ) [static]
PLINPUT_API void PLInput::InputManager::Update ( )

Update input manager once per frame.

Remarks:
This function must be called once per frame to allow devices to update their status and to process input messages read from these devices. This is also done to make sure that input messages are processed synchronously in the main thread, rather than sending messages from other threads asynchronously.
PLINPUT_API void PLInput::InputManager::DetectDevices ( bool  bReset = false)

Detect devices.

Parameters:
[in]bResetIf 'true', delete all input devices and re-detect them all. Otherwise, only new and removed input devices will be detected.
Remarks:
bReset = true should only be used if really necessary, because existing input handlers will most certainly lose their connection to the device.

Get list of input providers.

Returns:
Provider list, do not destroy the returned instances!

Get list of detected input providers.

Returns:
Provider list, do not destroy the returned instances!
PLINPUT_API Provider* PLInput::InputManager::GetProvider ( const PLCore::String sProvider)

Get a specific input provider.

Parameters:
[in]sProviderName of provider
Returns:
Provider, or a null pointer if it doesn't exist, do not destroy the returned instance!

Get list of devices.

Returns:
Device list, do not destroy the returned instances!
PLINPUT_API Device* PLInput::InputManager::GetDevice ( const PLCore::String sDevice) const

Get a specific device.

Parameters:
[in]sDeviceName of device
Returns:
Device, or a null pointer if it doesn't exist, do not destroy the returned instance!

Get default keyboard device.

Returns:
Default keyboard, can be a null pointer, do not destroy the returned instance!
PLINPUT_API Mouse* PLInput::InputManager::GetMouse ( ) const

Get default mouse device.

Returns:
Default mouse, can be a null pointer, do not destroy the returned instance!

Member Data Documentation

Called when device detection has started or stopped

An input controller has been found. Use this event to for instance connect the input controller to real input devices. Found input controller as first parameter, input semantic as second parameter.


The documentation for this class was generated from the following file:


PixelLight PixelLight 0.9.10-R1
Copyright (C) 2002-2011 by The PixelLight Team
Last modified Fri Dec 23 2011 15:51:19
The content of this PixelLight document is published under the
Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported