Skip to content

input_system::key_bind

Paweł Waligóra edited this page Apr 25, 2024 · 2 revisions

Description

Class made for binding key actions with function calls. One instance = one such bind.

Usage

Just declare input_system::key_bind variable in a script scope and define it either on declaration or in script constructor.

Example

namespace game {
	class player : public scripts_system::script {
	public:
		player();
		void update() override;
	private:
		void jump();
		input_system::key_bind jump_key_bind = input_system::key_bind(std::bind(&game::player::jump, this), GLFW_KEY_SPACE, GLFW_PRESS);
	};
}

In above example any time space is pressed jump fuction will be called.

Home

Git Workflow

Issues

Coding Rules

Skrypty-Tutorial

Useful resources

Game Structure

Code Structure

Clone this wiki locally