4drik
Advanced OT User
- Joined
- Jun 30, 2014
- Messages
- 254
- Reaction score
- 202
I tried to do onEscape (close window by key - "Escape") for miniWindows.
Currently it only works for MainWindows so I wanted to extend it.
In corelib/ui/uiwindow is
so I thought it was enough to edit it and put to uiminiwindow something like that
but no effect so I don't have more ideas.
Currently it only works for MainWindows so I wanted to extend it.
In corelib/ui/uiwindow is
Lua:
function UIWindow:onKeyDown(keyCode, keyboardModifiers)
if keyboardModifiers == KeyboardNoModifier then
if keyCode == KeyEnter then
signalcall(self.onEnter, self)
elseif keyCode == KeyEscape then
signalcall(self.onEscape, self)
end
end
end
so I thought it was enough to edit it and put to uiminiwindow something like that
Lua:
function UIMiniWindow:onKeyDown(keyCode, keyboardModifiers)
if keyboardModifiers == KeyboardNoModifier then
if keyCode == KeyEscape then
signalcall(self.onEscape, self)
end
end
end
but no effect so I don't have more ideas.