make HotkeyLabels react to clicking

also be better about initializing EditField frame height
develop
myk002 2022-07-17 16:04:36 -07:00 committed by Myk
parent 8de8b22566
commit 4e382c7b3b
1 changed files with 15 additions and 1 deletions

@ -187,10 +187,14 @@ EditField.ATTRS{
on_submit2 = DEFAULT_NIL, on_submit2 = DEFAULT_NIL,
key = DEFAULT_NIL, key = DEFAULT_NIL,
key_sep = DEFAULT_NIL, key_sep = DEFAULT_NIL,
frame = {h=1},
modal = false, modal = false,
} }
function EditField:preinit(init_table)
local frame = init_table.frame or {}
frame.h = frame.h or 1
end
function EditField:init() function EditField:init()
local function on_activate() local function on_activate()
self.saved_text = self.text self.saved_text = self.text
@ -744,6 +748,16 @@ function HotkeyLabel:init()
on_activate=self.on_activate}} on_activate=self.on_activate}}
end end
function HotkeyLabel:onInput(keys)
if HotkeyLabel.super.onInput(self, keys) then
return true
elseif keys._MOUSE_L and self:getMousePos() then
self.on_activate()
return true
end
end
---------------------- ----------------------
-- CycleHotkeyLabel -- -- CycleHotkeyLabel --
---------------------- ----------------------