|
|
|
@ -312,6 +312,7 @@ end
|
|
|
|
|
|
|
|
|
|
function VirtualKey:paintTo(bb, x ,y)
|
|
|
|
|
InputContainer.paintTo(self, bb, x, y)
|
|
|
|
|
|
|
|
|
|
-- Fudge self.dimen to include the padding, to make sure said padding is covered by our ges_events range...
|
|
|
|
|
-- Like Geom, floor coordinates & ceil dims, to fill the gaps without overlaps.
|
|
|
|
|
local coords_padding = math.floor(self.keyboard.key_padding / 2)
|
|
|
|
@ -359,7 +360,7 @@ function VirtualKey:update_keyboard(want_flash, want_a2)
|
|
|
|
|
-- We flash the *full* keyboard when we release a hold.
|
|
|
|
|
if want_flash then
|
|
|
|
|
UIManager:setDirty(self.keyboard, function()
|
|
|
|
|
return "flashui", self.keyboard[1][1].dimen -- i.e., keyboard_frame
|
|
|
|
|
return "flashui", self.keyboard.dimen
|
|
|
|
|
end)
|
|
|
|
|
else
|
|
|
|
|
local refresh_type = "ui"
|
|
|
|
@ -367,6 +368,8 @@ function VirtualKey:update_keyboard(want_flash, want_a2)
|
|
|
|
|
refresh_type = "a2"
|
|
|
|
|
end
|
|
|
|
|
-- Only repaint the key itself, not the full board...
|
|
|
|
|
-- NOTE: We use self[1] (i.e., FrameContainer),
|
|
|
|
|
-- because we fudge self.dimen to include the padding for the gesture hitbox...
|
|
|
|
|
UIManager:widgetRepaint(self[1], self[1].dimen.x, self[1].dimen.y)
|
|
|
|
|
logger.dbg("update key", self.key)
|
|
|
|
|
UIManager:setDirty(nil, refresh_type, self[1].dimen)
|
|
|
|
@ -504,7 +507,7 @@ VirtualKeyPopup = FocusManager:extend{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function VirtualKeyPopup:onTapClose(arg, ges)
|
|
|
|
|
if ges.pos:notIntersectWith(self[1][1].dimen) then
|
|
|
|
|
if ges.pos:notIntersectWith(self.dimen) then
|
|
|
|
|
UIManager:close(self)
|
|
|
|
|
return true
|
|
|
|
|
end
|
|
|
|
@ -519,7 +522,7 @@ end
|
|
|
|
|
function VirtualKeyPopup:onCloseWidget()
|
|
|
|
|
self:free()
|
|
|
|
|
UIManager:setDirty(nil, function()
|
|
|
|
|
return "ui", self[1][1].dimen -- i.e., keyboard_frame
|
|
|
|
|
return "ui", self.dimen
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -706,6 +709,7 @@ function VirtualKeyPopup:init()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
keyboard_frame.dimen = keyboard_frame:getSize()
|
|
|
|
|
self.dimen = keyboard_frame.dimen
|
|
|
|
|
|
|
|
|
|
self.ges_events.TapClose = {
|
|
|
|
|
GestureRange:new{
|
|
|
|
@ -762,7 +766,7 @@ function VirtualKeyPopup:init()
|
|
|
|
|
UIManager:show(self)
|
|
|
|
|
-- Ensure the post-paint refresh will be able to grab updated coordinates from keyboard_frame by using a refresh function
|
|
|
|
|
UIManager:setDirty(self, function()
|
|
|
|
|
return "ui", keyboard_frame.dimen
|
|
|
|
|
return "ui", self.dimen
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -938,7 +942,7 @@ function VirtualKeyboard:_refresh(want_flash, fullscreen)
|
|
|
|
|
return
|
|
|
|
|
end
|
|
|
|
|
UIManager:setDirty(self, function()
|
|
|
|
|
return refresh_type, self[1][1].dimen -- i.e., keyboard_frame
|
|
|
|
|
return refresh_type, self.dimen
|
|
|
|
|
end)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
@ -1097,9 +1101,9 @@ function VirtualKeyboard:addKeys()
|
|
|
|
|
dimen = Screen:getSize(),
|
|
|
|
|
keyboard_frame,
|
|
|
|
|
}
|
|
|
|
|
-- Beware, this won't be updated post-paint, so the coordinates will stay at (0, 0)
|
|
|
|
|
-- (i.e., only the size is accurate, not the position).
|
|
|
|
|
self.dimen = keyboard_frame:getSize()
|
|
|
|
|
-- Point our top-level dimen to the relevant widget, keyboard_frame
|
|
|
|
|
keyboard_frame.dimen = keyboard_frame:getSize()
|
|
|
|
|
self.dimen = keyboard_frame.dimen
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function VirtualKeyboard:setLayer(key)
|
|
|
|
|