From fdba16e2f28ee1424b769237e0c380559b675d40 Mon Sep 17 00:00:00 2001 From: Kazhnuz Date: Sun, 14 Apr 2019 18:27:24 +0200 Subject: [PATCH] options: add a way to set an input key --- gamecore/options.lua | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gamecore/options.lua b/gamecore/options.lua index 39a8cd1..361d211 100644 --- a/gamecore/options.lua +++ b/gamecore/options.lua @@ -105,6 +105,14 @@ function OptionsManager:getInputData() return self.data.input end +function OptionsManager:setInputKey(sourceid, padkey, key) + if self.data.input[sourceid] ~= nil then + if self.data.input[sourceid].keys[padkey] ~= nil then + self.data.input[sourceid].keys[padkey] = key + end + end +end + -- Lang data function OptionsManager:getTranslationDefaultData()