mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-12 03:45:34 +00:00
fix(ios): globe key 'longpress' workaround
This commit is contained in:
parent
ebb607adcc
commit
07475cfaf5
1 changed files with 7 additions and 0 deletions
|
|
@ -449,9 +449,12 @@ extension KeymanWebViewController: WKScriptMessageHandler {
|
|||
|
||||
self.touchHoldBegan()
|
||||
} else if fragment.hasPrefix("#menuKeyDown-") {
|
||||
perform(#selector(self.menuKeyHeld), with: self, afterDelay: 0.5)
|
||||
menuKeyDown(self)
|
||||
delegate?.menuKeyDown(self)
|
||||
} else if fragment.hasPrefix("#menuKeyUp-") {
|
||||
// Blocks summoning the globe-key menu for quick taps. (Hence the 0.5 delay.)
|
||||
NSObject.cancelPreviousPerformRequests(withTarget: self, selector: #selector(self.menuKeyHeld), object: self)
|
||||
menuKeyUp(self)
|
||||
delegate?.menuKeyUp(self)
|
||||
} else if fragment.hasPrefix("#hideKeyboard-") {
|
||||
|
|
@ -834,6 +837,10 @@ extension KeymanWebViewController: UIGestureRecognizerDelegate {
|
|||
setPopupVisible(true)
|
||||
}
|
||||
|
||||
@objc func menuKeyHeld(_ keymanWeb: KeymanWebViewController) {
|
||||
self.delegate?.menuKeyHeld(self)
|
||||
}
|
||||
|
||||
@objc func subKeyButtonClick(_ sender: UIButton) {
|
||||
let keyIndex = sender.tag
|
||||
if keyIndex < subKeyIDs.count && keyIndex < subKeyTexts.count {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue