mirror of
https://github.com/OTCv8/otclientv8.git
synced 2025-10-19 06:03:27 +02:00
Version 0.99 BETA
This commit is contained in:
@@ -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 = {}
|
||||
|
Reference in New Issue
Block a user