Merge pull request #1003 from diath/fix_keyboard_desc

Fix an issue with key combo desc not working properly with integer keys
This commit is contained in:
Konrad Kuśnierz 2019-01-16 13:25:37 +01:00 committed by GitHub
commit 710212c23a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -26,6 +26,11 @@ local function retranslateKeyComboDesc(keyComboDesc)
if keyComboDesc == nil then if keyComboDesc == nil then
error('Unable to translate key combo \'' .. keyComboDesc .. '\'') error('Unable to translate key combo \'' .. keyComboDesc .. '\'')
end end
if type(keyComboDesc) == 'number' then
keyComboDesc = tostring(keyComboDesc)
end
local keyCombo = {} local keyCombo = {}
for i,currentKeyDesc in ipairs(keyComboDesc:split('+')) do for i,currentKeyDesc in ipairs(keyComboDesc:split('+')) do
for keyCode, keyDesc in pairs(KeyCodeDescs) do for keyCode, keyDesc in pairs(KeyCodeDescs) do