Olá
quando vamos adicionar uma nova hotkey no OTC
1° clicamos em add, e abre uma tela que vai identificar a próxima tecla que vamos apertar
esta parte reconhece as teclas do teclado, porém nenhuma do mouse
como eu faria para adicionar esta função, para ele reconhecer as teclas do mouse também ?
mais especificamente o midbutton (bolinha do mouse sendo pressionada )
acredito que deve ser nesta parte do hotkey_manager.lua
function addHotkey()
local assignWindow = g_ui.createWidget('HotkeyAssignWindow', rootWidget)
assignWindow:grabKeyboard()
local comboLabel = assignWindow:getChildById('comboPreview')
comboLabel.keyCombo = ''
assignWindow.onKeyDown = hotkeyCapture
end
function addKeyCombo(keyCombo, keySettings, focus)
if keyCombo == nil or #keyCombo == 0 then return end
if not keyCombo then return end
local hotkeyLabel = currentHotkeys:getChildById(keyCombo)
if not hotkeyLabel then
hotkeyLabel = g_ui.createWidget('HotkeyListLabel')
hotkeyLabel:setId(keyCombo)
local children = currentHotkeys:getChildren()
children[#children+1] = hotkeyLabel
table.sort(children, function(a,b)
if a:getId():len() < b:getId():len() then
return true
elseif a:getId():len() == b:getId():len() then
return a:getId() < b:getId()
else
return false
end
end)
for i=1,#children do
if children == hotkeyLabel then
currentHotkeys:insertChild(i, hotkeyLabel)
break
end
end
if keySettings then
currentHotkeyLabel = hotkeyLabel
hotkeyLabel.keyCombo = keyCombo
hotkeyLabel.autoSend = toboolean(keySettings.autoSend)
hotkeyLabel.itemId = tonumber(keySettings.itemId)
hotkeyLabel.useType = tonumber(keySettings.useType)
if keySettings.value then hotkeyLabel.value = tostring(keySettings.value) end
else
hotkeyLabel.keyCombo = keyCombo
hotkeyLabel.autoSend = false
hotkeyLabel.itemId = nil
hotkeyLabel.useType = nil
hotkeyLabel.value = ''
end
updateHotkeyLabel(hotkeyLabel)
boundCombosCallback[keyCombo] = function() doKeyCombo(keyCombo) end
g_keyboard.bindKeyPress(keyCombo, boundCombosCallback[keyCombo])
end
if focus then
currentHotkeys:focusChild(hotkeyLabel)
currentHotkeys:ensureChildVisible(hotkeyLabel)
updateHotkeyForm(true)
end
end
obrigado !