@ -520,6 +520,17 @@ function VirtualKeyPopup:init()
virtual_key.hold_callback = nil
-- close popup on hold release
virtual_key.onHoldReleaseKey = function ( )
-- NOTE: Check our *parent* key!
if parent_key.ignore_key_release then
parent_key.ignore_key_release = nil
return true
end
Device : performHapticFeedback ( " LONG_PRESS " )
if virtual_key.keyboard . ignore_first_hold_release then
virtual_key.keyboard . ignore_first_hold_release = false
return true
end
virtual_key : onTapSelect ( true )
UIManager : close ( self )
return true
@ -630,13 +641,19 @@ function VirtualKeyPopup:init()
}
if position_container.dimen . x < 0 then
position_container.dimen . x = 0
-- We effectively move the popup, which means the key underneath our finger may no longer *exactly* be parent_key.
-- Make sure we won't close the popup right away, as that would risk being a *different* key, in order to make that less confusing.
parent_key.ignore_key_release = true
elseif position_container.dimen . x + keyboard_frame.dimen . w > Screen : getWidth ( ) then
position_container.dimen . x = Screen : getWidth ( ) - keyboard_frame.dimen . w
parent_key.ignore_key_release = true
end
if position_container.dimen . y < 0 then
position_container.dimen . y = 0
parent_key.ignore_key_release = true
elseif position_container.dimen . y + keyboard_frame.dimen . h > Screen : getHeight ( ) then
position_container.dimen . y = Screen : getHeight ( ) - keyboard_frame.dimen . h
parent_key.ignore_key_release = true
end
self [ 1 ] = position_container