fix and remove lock
This commit is contained in:
parent
f3e9fc7cd4
commit
15fce6d4cf
|
@ -34,7 +34,6 @@ local hotkeyColors = {
|
||||||
|
|
||||||
-- public functions
|
-- public functions
|
||||||
function HotkeysManager.init()
|
function HotkeysManager.init()
|
||||||
print("PASSO HK INIT")
|
|
||||||
hotkeysWindow = displayUI('hotkeys_manager.otui')
|
hotkeysWindow = displayUI('hotkeys_manager.otui')
|
||||||
|
|
||||||
hotkeysWindow:setVisible(false)
|
hotkeysWindow:setVisible(false)
|
||||||
|
@ -131,14 +130,12 @@ function HotkeysManager.show()
|
||||||
if g_game.isOnline() then
|
if g_game.isOnline() then
|
||||||
hotkeysWindow:grabKeyboard()
|
hotkeysWindow:grabKeyboard()
|
||||||
hotkeysWindow:show()
|
hotkeysWindow:show()
|
||||||
hotkeysWindow:lock()
|
|
||||||
hotkeysWindow:raise()
|
hotkeysWindow:raise()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function HotkeysManager.hide()
|
function HotkeysManager.hide()
|
||||||
hotkeysWindow:ungrabKeyboard()
|
hotkeysWindow:ungrabKeyboard()
|
||||||
hotkeysWindow:unlock()
|
|
||||||
hotkeysWindow:hide()
|
hotkeysWindow:hide()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -201,7 +198,7 @@ end
|
||||||
function HotkeysManager.addHotkey()
|
function HotkeysManager.addHotkey()
|
||||||
local widget
|
local widget
|
||||||
|
|
||||||
messageBox = createWidget('MainWindow', hotkeysWindow)
|
messageBox = createWidget('MainWindow', rootWidget)
|
||||||
messageBox:grabKeyboard()
|
messageBox:grabKeyboard()
|
||||||
messageBox:setId('assignWindow')
|
messageBox:setId('assignWindow')
|
||||||
messageBox:setText('Button Assign')
|
messageBox:setText('Button Assign')
|
||||||
|
@ -449,11 +446,11 @@ end
|
||||||
|
|
||||||
function HotkeysManager.hotkeyCapture(widget, keyCode, keyboardModifiers)
|
function HotkeysManager.hotkeyCapture(widget, keyCode, keyboardModifiers)
|
||||||
local keyCombo = determineKeyComboDesc(keyCode, keyboardModifiers)
|
local keyCombo = determineKeyComboDesc(keyCode, keyboardModifiers)
|
||||||
local comboPreview = hotkeysWindow:getChildById('assignWindow'):getChildById('comboPreview')
|
local comboPreview = rootWidget:getChildById('assignWindow'):getChildById('comboPreview')
|
||||||
comboPreview:setText('Current hotkey to add: '.. keyCombo)
|
comboPreview:setText('Current hotkey to add: '.. keyCombo)
|
||||||
comboPreview.keyCombo = keyCombo
|
comboPreview.keyCombo = keyCombo
|
||||||
comboPreview:resizeToText()
|
comboPreview:resizeToText()
|
||||||
hotkeysWindow:getChildById('assignWindow'):getChildById('addButton'):enable()
|
rootWidget:getChildById('assignWindow'):getChildById('addButton'):enable()
|
||||||
|
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue