From 1e28f63bcf7b465cc940af18a08855d377370ac3 Mon Sep 17 00:00:00 2001 From: Nibodhika Date: Tue, 3 Apr 2018 22:29:07 +0000 Subject: Allows to map an action to all devices. This is accomplished by setting a special value (-1) to the device variable in the InputEvent that's being used to compare with the one received from the OS. This special value is invalid for a regular input, so it should be safe. Implements #17942 --- core/input_map.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core/input_map.h') diff --git a/core/input_map.h b/core/input_map.h index 84d90f6f2a..9f3c13c2cf 100644 --- a/core/input_map.h +++ b/core/input_map.h @@ -39,6 +39,11 @@ class InputMap : public Object { GDCLASS(InputMap, Object); public: + /** + * A special value used to signify that a given Action can be triggered by any device + */ + static int ALL_DEVICES; + struct Action { int id; List > inputs; -- cgit v1.2.3