Version 0.99 BETA

This commit is contained in:
OTCv8
2019-10-06 12:00:34 +02:00
parent b016c1dca4
commit bc977c268e
14 changed files with 115 additions and 17 deletions

View File

@@ -187,6 +187,31 @@ function g_keyboard.isKeyPressed(key)
return g_window.isKeyPressed(key)
end
function g_keyboard.areKeysPressed(keyComboDesc)
for i,currentKeyDesc in ipairs(keyComboDesc:split('+')) do
for keyCode, keyDesc in pairs(KeyCodeDescs) do
if keyDesc:lower() == currentKeyDesc:trim():lower() then
if keyDesc:lower() == "ctrl" then
if not g_keyboard.isCtrlPressed() then
return false
end
elseif keyDesc:lower() == "shift" then
if not g_keyboard.isShiftPressed() then
return false
end
elseif keyDesc:lower() == "alt" then
if not g_keyboard.isAltPressed() then
return false
end
elseif not g_window.isKeyPressed(keyCode) then
return false
end
end
end
end
return true
end
function g_keyboard.isKeySetPressed(keys, all)
all = all or false
local result = {}