SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | List of all members
KeyboardConfig Class Reference

specialisation of DeviceConfig for keyboard type devices More...

#include <keyboard_config.hpp>

Inheritance diagram for KeyboardConfig:
Inheritance graph
[legend]

Public Member Functions

virtual void setDefaultBinds ()
 
virtual void save (std::ofstream &stream)
 Saves the configuration to a file.
 
virtual bool isGamePad () const
 
virtual bool isKeyboard () const
 
- Public Member Functions inherited from DeviceConfig
irr::core::stringw toString ()
 
bool hasBindingFor (const int buttonID) const
 
bool hasBindingFor (const int buttonID, PlayerAction from, PlayerAction to) const
 
void setBinding (const PlayerAction action, const Input::InputType type, const int id, Input::AxisDirection direction=Input::AD_NEUTRAL, Input::AxisRange range=Input::AR_HALF)
 Sets the bindings for an action.
 
bool getMenuAction (Input::InputType type, const int id, int *value, PlayerAction *action)
 Searches for a game actions associated with the given input event.
 
irr::core::stringw getMappingIdString (const PlayerAction action) const
 Get an internal unique string describing the bound action.
 
virtual irr::core::stringw getBindingAsString (const PlayerAction action) const
 Get a user-readable string describing the bound action.
 
virtual bool isGamePad () const =0
 
virtual bool isKeyboard () const =0
 
virtual void save (std::ofstream &stream)
 Saves the configuration to a file.
 
virtual bool load (const XMLNode *config)
 Reads a device configuration from input.xml.
 
virtual bool isAnalog (Input::InputType type, int id) const
 Returns true if this device has analog axis, so that steering values will not be affected by time-full-steer delays.
 
virtual bool desensitize () const
 Returns true if this device should desensitize its input at values close to 0 (to avoid 'oversteering').
 
virtual int getNumberOfButtons () const
 Should only be called for gamepads, which has its own implementation.
 
virtual int getNumberOfAxes () const
 Should only be called for gamepads, which has its own implementation.
 
void setName (const std::string &name)
 Sets the internal name of this device.
 
const std::string & getName () const
 Returns the internal name for this device configuration.
 
void setPlugged ()
 Increase ref counter.
 
bool isPlugged () const
 Returns if this config is sed by any devices.
 
void unPlugged ()
 Decrease ref counter.
 
int getNumberOfDevices () const
 Returns the number of devices using this configuration.
 
const BindinggetBinding (int i) const
 Returns the binding of a given index.
 
bool isEnabled () const
 At this time only relevant for gamepads, keyboards are always enabled.
 
void setEnabled (bool new_value)
 Sets this config to be enabled or disabled.
 
irr::core::stringw getConfigName () const
 Sets the name of this device configuration.
 
void setConfigName (irr::core::stringw config_name)
 Returns the name of this device configuration.
 

Additional Inherited Members

- Static Public Member Functions inherited from DeviceConfig
static DeviceConfigcreate (const XMLNode *config)
 A simple factory that creates either a gamepad or a keyboard configuration.
 
- Protected Member Functions inherited from DeviceConfig
bool doGetAction (Input::InputType type, const int id, int *value, const PlayerAction firstActionToCheck, const PlayerAction lastActionToCheck, PlayerAction *action)
 internal helper method for DeviceConfig::getGameAction and DeviceConfig::getMenuAction
 
bool getGameAction (Input::InputType type, const int id, int *value, PlayerAction *action)
 Searches for a game actions associated with the given input event.
 
- Protected Attributes inherited from DeviceConfig
Binding m_bindings [PA_COUNT]
 

Detailed Description

specialisation of DeviceConfig for keyboard type devices

Member Function Documentation

◆ isGamePad()

virtual bool KeyboardConfig::isGamePad ( ) const
inlinevirtual

Implements DeviceConfig.

◆ isKeyboard()

virtual bool KeyboardConfig::isKeyboard ( ) const
inlinevirtual

Implements DeviceConfig.

◆ save()

void KeyboardConfig::save ( std::ofstream &  stream)
virtual

Saves the configuration to a file.

It writes the name for a gamepad config, saves the device specific parameters, and calls DeviceConfig::save() to save the rest.

Parameters
streamThe stream to save to.

Reimplemented from DeviceConfig.


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