Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change(android,web) Use web-based popup key longpresses #9591

Merged
merged 9 commits into from
Sep 22, 2023
52 changes: 0 additions & 52 deletions android/KMEA/app/src/main/assets/android-host.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,58 +229,12 @@ function updateKMSelectionRange(start, end) {
}

var lastKeyTip = null;
function oskCreateKeyPreview(x,y,w,h,t) {
if(lastKeyTip &&
lastKeyTip.t == t &&
lastKeyTip.x == x &&
lastKeyTip.y == y &&
lastKeyTip.w == w &&
lastKeyTip.h == h) {
return;
}
lastKeyTip = {x:x,y:y,w:w,h:h,t:t};

fragmentToggle = (fragmentToggle + 1) % 100;
var div = document.createElement('div');
div.innerHTML = t;
var dt = div.firstChild.nodeValue;
window.location.hash = 'showKeyPreview-'+fragmentToggle+'+x='+x+'+y='+y+'+w='+w+'+h='+h+'+t='+toHex(dt);
}

function oskClearKeyPreview() {
lastKeyTip = null;
fragmentToggle = (fragmentToggle + 1) % 100;
window.location.hash = 'dismissKeyPreview-'+fragmentToggle;
}

function signalHelpBubbleDismissal() {
fragmentToggle = (fragmentToggle + 1) % 100;
window.location.hash = 'helpBubbleDismissed-'+fragmentToggle;
}

function oskCreatePopup(obj,x,y) {
if(obj != null) {
var i;
var s = '';
var shift = false;
var keyPos = x.toString() + ',' + y.toString();
for(i=0; i<obj.length; i++)
{
// elementID contains the layer and coreID
s=s+obj[i].elementID;
if(obj[i].sp == 1 || obj[i].sp == 2) shift = true;
if(typeof(obj[i].text) != 'undefined' && obj[i].text != null && obj[i].text != '') s=s+':'+toHex(obj[i].text);
if(i < (obj.length -1)) s=s+';'
}
fragmentToggle=(fragmentToggle+1) % 100;
var hash = 'showMore-' + fragmentToggle + '+keyPos=' + keyPos + '+keys=' + s;
if(shift) {
hash = hash + '+font=' + 'SpecialOSK';
}
window.location.hash = hash;
}
}

function suggestionPopup(obj,custom,x,y,w,h) {
if(obj != null) {
var s = JSON.stringify(obj);
Expand Down Expand Up @@ -320,12 +274,6 @@ function showKeyboard() {
keyman.refreshOskLayout();
}

function executePopupKey(keyID, keyText) {
// KMW only needs keyID to process the popup key. keyText merely logged to console
//window.console.log('executePopupKey('+keyID+'); keyText: ' + keyText);
keyman.executePopupKey(keyID);
}

Comment on lines -323 to -328
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re: a recent comment in one of the other threads.

// Cannot make it explicitly async / await on API 21.
function executeHardwareKeystroke(code, shift, lstates, eventModifiers) {
console_debug('executeHardwareKeystroke(code='+code+',shift='+shift+',lstates='+lstates+',eventModifiers='+eventModifiers+')');
Expand Down

This file was deleted.

Loading