29 #ifndef _KeyBinder_H__ 30 #define _KeyBinder_H__ 71 unsigned int getNumberOfBindings(
const std::string& commandName);
74 {
return this->filename_; }
75 void setConfigValues();
76 void resetJoyStickAxes();
77 void resetMouseAxes();
83 void buttonThresholdChanged();
84 void initialiseJoyStickBindings();
85 void compilePointerLists();
87 virtual void JoyStickQuantityChanged(
const std::vector<JoyStick*>& joyStickList)
override;
89 virtual void allDevicesUpdated(
float dt)
override;
90 virtual void mouseUpdated(
float dt)
override;
91 virtual void joyStickUpdated(
unsigned int joyStick,
float dt)
override;
93 void tickHalfAxis(
HalfAxis& halfAxis);
95 virtual void buttonPressed (
const KeyEvent& evt)
override;
96 virtual void buttonReleased(
const KeyEvent& evt)
override;
97 virtual void buttonHeld (
const KeyEvent& evt)
override;
103 virtual void mouseScrolled (
int abs,
int rel)
override;
108 virtual void axisMoved (
unsigned int device,
unsigned int axis,
float value)
override;
119 Button mouseButtons_ [numberOfMouseButtons_];
155 float mousePosition_[2];
157 int mouseRelative_[2];
193 static const int mouseClippingSize_ = 1024;
Different definitions of input processing.
Derive from this class to get informed when joy sticks get added/removed.
Definition: JoyStickQuantityListener.h:45
float deriveTime_
Definition: KeyBinder.h:158
The ConsoleCommand class stores all information about a console command which can be executed by Comm...
Definition: ConsoleCommand.h:88
std::vector< std::shared_ptr< JoyStickAxisVector > > joyStickAxes_
Actual key bindings for joy stick axes (and sliders)
Definition: KeyBinder.h:138
std::map< std::string, std::vector< std::string > > allCommands_
Maps input commands to all Button names, including half axes.
Definition: KeyBinder.h:145
virtual void buttonPressed(const KeyEvent &evt) override
Definition: KeyBinder.h:197
Definition: CorePrereqs.h:126
::std::string string
Definition: gtest-port.h:756
std::vector< JoyStick * > joySticks_
Currently active joy sticks.
Definition: KeyBinder.h:112
int mouseWheelStepSize_
Equals one step of the mouse wheel.
Definition: KeyBinder.h:186
This class represents a config file, which is stored on the hard-disk and contains config values in d...
Definition: ConfigFile.h:51
const unsigned int numberOfKeys
Definition: InputPrereqs.h:53
float totalMouseSensitivity_
Multiplication of mouse sensitivity and clipping size.
Definition: KeyBinder.h:189
std::map< std::string, Button * > allButtons_
Pointer map with all Buttons, including half axes.
Definition: KeyBinder.h:141
std::vector< HalfAxis * > allHalfAxes_
Pointer list with all half axes.
Definition: KeyBinder.h:143
float mouseSensitivity_
mouse sensitivity
Definition: KeyBinder.h:182
bool bFilterAnalogNoise_
Whether to filter small value analog input.
Definition: KeyBinder.h:172
Definition: CorePrereqs.h:128
const unsigned int numberOfAxes
Definition: InputPrereqs.h:410
Definition: CorePrereqs.h:127
HalfAxis & operator[](unsigned int index)
Definition: KeyBinder.h:134
virtual void buttonReleased(const KeyEvent &evt) override
Definition: KeyBinder.h:200
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
ARGUMENT_COMPLETION_FUNCTION_IMPLEMENTATION_MULTI() command(const std::string &fragment)
Returns a list of commands and groups and also supports auto-completion of the arguments of these com...
Definition: ArgumentCompletionFunctions.cc:178
float buttonThreshold_
Threshold for analog triggers until which the button is not pressed.
Definition: KeyBinder.h:176
Value
Definition: CorePrereqs.h:124
Maps mouse, keyboard and joy stick input to command strings and executes them.
Definition: KeyBinder.h:59
#define _CoreExport
Definition: CorePrereqs.h:61
Definition: InputCommands.h:43
ConfigFile * fallbackConfigFile_
Config file from the data directory that only serves as fallback.
Definition: KeyBinder.h:165
KeyCode::ByEnum getKeyCode() const
Definition: InputHandler.h:98
const std::string & getBindingsFilename()
Definition: KeyBinder.h:73
Event argument for key events.
Definition: InputHandler.h:76
float mouseSensitivityDerived_
mouse sensitivity if mouse input is derived
Definition: KeyBinder.h:184
A Vector class containing two integers x and y.
Definition: InputHandler.h:37
Helper class to use something like std:vector<HalfAxis[48]>
Definition: KeyBinder.h:132
const std::string filename_
Name of the file used in this KeyBinder (constant!)
Definition: KeyBinder.h:161
virtual void buttonHeld(const KeyEvent &evt) override
Definition: KeyBinder.h:203
bool bDeriveMouseInput_
Derive mouse input for absolute values?
Definition: KeyBinder.h:178
const unsigned int numberOfAxes
Definition: InputPrereqs.h:339
Definition: HalfAxis.h:45
virtual void allDevicesUpdated(float dt) override
Definition: KeyBinder.h:226
std::vector< BufferedParamCommand * > paramCommandBuffer_
Commands that have additional parameters (axes) are executed at the end of update() so that all value...
Definition: KeyBinder.h:152
float derivePeriod_
Accuracy of the mouse input deriver. The higher the more precise, but laggier.
Definition: KeyBinder.h:180
float analogThreshold_
Threshold for analog triggers until which the state is 0.
Definition: KeyBinder.h:174
ConfigFile * configFile_
Config file used. nullptr in case of KeyDetector. Also indicates whether we've already loaded...
Definition: KeyBinder.h:163
std::vector< std::shared_ptr< JoyStickButtonVector > > joyStickButtons_
Actual key bindings for joy stick buttons.
Definition: KeyBinder.h:130