-
Notifications
You must be signed in to change notification settings - Fork 178
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🧩 Scripting: Added global object 'inputs' (InputEngine) and enum 'inp…
…utEvents'. Enum inputEvents contains all values of enum `events` in InputEngine.h. Object InputEngineClass contains only a few important functions of InputEngine, see InputEngineAngelscript.cpp for listing. InputEngine.h: just formatted the enum comments, no code change. Demo script extended to showcase new abilities. Added doxygen doc.
- Loading branch information
Showing
9 changed files
with
1,045 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
|
||
|
||
/** | ||
* @brief Manages input devices, their configuration (input.map ...) and state. | ||
* @note This object is created automatically as global variable `inputs`. | ||
*/ | ||
class InputEngineClass | ||
{ | ||
public: | ||
/** | ||
* @return full configuration string for given command, including the EXPL modifier. | ||
*/ | ||
string getEventCommand(inputEvents ev); | ||
|
||
/** | ||
* @return configuration string for given command, omitting the EXPL modifier. | ||
*/ | ||
string getEventCommandTrimmed(inputEvents ev); | ||
|
||
/** | ||
* @return true if the event input is active (keyboard key pressed etc.). | ||
*/ | ||
bool getEventBoolValue(inputEvents ev); | ||
|
||
/** | ||
* @return true if the event input is active (keyboard key pressed etc.) | ||
* and the bouncing on/off cycle is in 'on' state. | ||
*/ | ||
bool getEventBoolValueBounce(inputEvents ev, float time=0.2); | ||
|
||
}; |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.