From 87b580d998be7dec76e353d85fbb4da2b3ccc7e9 Mon Sep 17 00:00:00 2001 From: Darcy Wong Date: Thu, 16 Sep 2021 10:29:58 +0700 Subject: [PATCH] fix(common/core/web): Remove empty rows in OSK --- .../src/keyboards/activeLayout.ts | 73 +-- web/source/osk/visualKeyboard.ts | 19 - web/testing/empty-row/afghan_turkmen-1.1.js | 1 + web/testing/empty-row/empty_row-1.0.js | 522 ++++++++++++++++++ web/testing/empty-row/index.html | 104 ++++ web/testing/index.html | 1 + 6 files changed, 669 insertions(+), 51 deletions(-) create mode 100644 web/testing/empty-row/afghan_turkmen-1.1.js create mode 100644 web/testing/empty-row/empty_row-1.0.js create mode 100644 web/testing/empty-row/index.html diff --git a/common/core/web/keyboard-processor/src/keyboards/activeLayout.ts b/common/core/web/keyboard-processor/src/keyboards/activeLayout.ts index 3f5e804139..10cf1a90dc 100644 --- a/common/core/web/keyboard-processor/src/keyboards/activeLayout.ts +++ b/common/core/web/keyboard-processor/src/keyboards/activeLayout.ts @@ -48,7 +48,7 @@ namespace com.keyman.keyboards { * Matches the key code as set within Keyman Developer for the layout. * For example, K_R or U_0020. Denotes either physical keys or virtual keys with custom output, * with no additional metadata like layer or active modifiers. - * + * * Is used to determine the keycode for input events, rule-matching, and keystroke processing. */ public get baseKeyID(): string { @@ -61,20 +61,20 @@ namespace com.keyman.keyboards { /** * A unique identifier based on both the key ID & the 'desktop layer' to be used for the key. - * + * * Allows diambiguation of scenarios where the same key ID is used twice within a layer, but * with different innate modifiers. (Refer to https://github.com/keymanapp/keyman/issues/4617) * The 'desktop layer' may be omitted if it matches the key's display layer. - * + * * Examples, given a 'default' display layer, matching keys to Keyman keyboard language: - * + * * ``` - * "K_Q" + * "K_Q" * + [K_Q] * "K_Q+shift" * + [K_Q SHIFT] * ``` - * + * * Useful when the active layer of an input-event is already known. */ public get coreID(): string { @@ -83,7 +83,7 @@ namespace com.keyman.keyboards { } let baseID = this.id || ''; - + if(this.displayLayer != this.layer) { baseID = baseID + '+' + this.layer; } @@ -94,19 +94,19 @@ namespace com.keyman.keyboards { /** * A keyboard-unique identifier to be used for any display elements representing this key * in user interfaces and/or on-screen keyboards. - * + * * Distinguishes between otherwise-identical keys on different layers of an OSK. * Includes identifying information about the key's display layer. - * + * * Examples, given a 'default' display layer, matching keys to Keyman keyboard language: - * + * * ``` - * "default-K_Q" + * "default-K_Q" * + [K_Q] * "default-K_Q+shift" * + [K_Q SHIFT] * ``` - * + * * Useful when only the active keyboard is known about an input event. */ public get elementID(): string { @@ -538,7 +538,7 @@ namespace com.keyman.keyboards { return; default: // Refer to text/codes.ts - these are Keyman-custom "keycodes" used for - // layer shifting keys. To be safe, we currently let K_TABBACK and + // layer shifting keys. To be safe, we currently let K_TABBACK and // K_TABFWD through, though we might be able to drop them too. let code = com.keyman.text.Codes[key.baseKeyID]; if(code > 50000 && code < 50011) { @@ -629,6 +629,31 @@ namespace com.keyman.keyboards { return this.layerMap[layerId]; } + /** + * Refer to https://github.com/keymanapp/keyman/issues/254, which mentions + * KD-11 from a prior issue-tracking system from the closed-source days that + * resulted in an unintended extra empty row. + * + * It'll be pretty rare to see a keyboard affected by the bug, but we don't + * 100% control all keyboards out there, so it's best we make sure the edge + * case is covered. + * + * @param layers The layer group to be loaded for the form factor. Will be + * mutated by this operation. + */ + static correctLayerEmptyRowBug(layers: LayoutLayer[]) { + for(let n=0; n=0; i--) { + if(!Array.isArray(rows[i]['key']) || rows[i]['key'].length == 0) { + rows.splice(i, 1) + } + } + } + } + /** * * @param layout @@ -640,27 +665,11 @@ namespace com.keyman.keyboards { } // Create a separate OSK div for each OSK layer, only one of which will ever be visible - var n: number, i: number; - var layers: LayoutLayer[], layer: LayoutLayer; + var n: number; let layerMap: {[layerId: string]: ActiveLayer} = {}; - var rows: LayoutRow[]; - layers=layout['layer']; - - // ***Delete any empty rows at the end added by compiler bug... - for(n=0; n0; i--) { - if(rows[i-1]['key'].length > 0) { - break; - } - } - - if(i < rows.length) { - rows.splice(i-rows.length,rows.length-i); - } - } - // ...remove to here when compiler bug fixed *** + let layers=layout['layer']; + ActiveLayout.correctLayerEmptyRowBug(layers); // Add class functions to the existing layout object, allowing it to act as an ActiveLayout. let dummy = new ActiveLayout(); diff --git a/web/source/osk/visualKeyboard.ts b/web/source/osk/visualKeyboard.ts index 26fffd92e6..f99ca9265d 100644 --- a/web/source/osk/visualKeyboard.ts +++ b/web/source/osk/visualKeyboard.ts @@ -863,25 +863,6 @@ namespace com.keyman.osk { var tKey=this.getDefaultKeyObject(); tKey['fontsize']=ls.fontSize; - // Identify key labels (e.g. *Shift*) that require the special OSK font - var specialLabel=/\*\w+\*/; - - // ***Delete any empty rows at the end added by compiler bug... - for(n=0; n0; i--) { - if(rows[i-1]['key'].length > 0) { - break; - } - } - - if(i < rows.length) { - rows.splice(i-rows.length,rows.length-i); - } - } - // ...remove to here when compiler bug fixed *** - // Set the OSK row height, **assuming all layers have the same number of rows** // Calculate default row height diff --git a/web/testing/empty-row/afghan_turkmen-1.1.js b/web/testing/empty-row/afghan_turkmen-1.1.js new file mode 100644 index 0000000000..85ed447eda --- /dev/null +++ b/web/testing/empty-row/afghan_turkmen-1.1.js @@ -0,0 +1 @@ +KeymanWeb.KR(new Keyboard_afghan_turkmen());function Keyboard_afghan_turkmen(){this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9;this.KI="Keyboard_afghan_turkmen";this.KN="Afghan Turkmen";this.KMINVER="9.0";this.KRTL=1;this.KV={F:' 1em "Arial"',K102:0};this.KV.KLS={"shift": ["~","!","٬","٫","ریال","٪","×","،","*",")","(","ـ","+","","","","ْ","ٌ","ٍ","ً","ُ","ِ","َ","ّ","]","[","}","{","|","","","","ؤ","ئ","ي","إ","أ","آ","ݩ","»","«",":","؛","","","","","","","ك","ې","ژ","ٰ","‌","ٔ","ۉ",">","<","؟","","","","","",""],"default": ["","۱","۲","۳","۴","۵","۶","۷","۸","۹","۰","-","=","","","","ض","ص","ث","ق","ف","غ","ع","ه","خ","ح","ج","چ","\\","","","","ش","س","ی","ب","ل","ا","ت","ن","م","ک","گ","","","","","","","ظ","ط","ز","ر","ذ","د","پ","و",".","/","","","","","",""]};this.KV.BK=(function(x){var e=Array.apply(null,Array(65)).map(String.prototype.valueOf,""),r=[],v,i,m=['default','shift','ctrl','shift-ctrl','alt','shift-alt','ctrl-alt','shift-ctrl-alt'];for(i=m.length-1;i>=0;i--)if((v=x[m[i]])||r.length)r=(v?v:e).slice().concat(r);return r})(this.KV.KLS);this.KDU=0;this.KH='';this.KM=0;this.KBVER="1.0";this.KMBM=0x0010;this.KVKL={"phone":{"displayUnderlying":false,"layer":[{"id":"default","row":[{"id":"1"},{"id":"2","key":[{"id":"K_Q","text":"\u0636"},{"id":"K_W","text":"\u0635"},{"id":"K_E","text":"\u062B"},{"id":"K_R","text":"\u0642"},{"id":"K_T","text":"\u0641"},{"id":"K_Y","text":"\u063A"},{"id":"K_U","text":"\u0639"},{"id":"K_I","text":"\u0647"},{"id":"K_O","text":"\u062E"},{"id":"K_P","text":"\u062D"},{"id":"K_LBRKT","text":"\u062C"}]},{"id":"3","key":[{"id":"K_A","text":"\u0634"},{"id":"K_S","text":"\u0633"},{"id":"K_D","text":"\u06CC"},{"id":"K_F","text":"\u0628"},{"id":"K_G","text":"\u0644"},{"id":"K_H","text":"\u0627"},{"id":"K_J","text":"\u062A"},{"id":"K_K","text":"\u0646"},{"id":"K_L","text":"\u0645"},{"id":"K_COLON","text":"\u06A9"},{"id":"K_QUOTE","text":"\u06AF"}]},{"id":"4","key":[{"id":"K_Z","text":"\u0638"},{"id":"K_X","text":"\u0637"},{"layer":"shift","id":"K_C","text":"\u0698"},{"id":"K_C","text":"\u0632"},{"id":"K_V","text":"\u0631"},{"id":"K_B","text":"\u0630"},{"id":"K_N","text":"\u062F"},{"id":"K_M","text":"\u067E"},{"id":"K_COMMA","text":"\u0648"},{"id":"K_RBRKT","text":"\u0686"},{"width":"100","id":"K_BKSP","sp":"1","text":"*BkSp*"}]},{"id":"5","key":[{"width":"160","id":"K_SHIFT","sp":"1","text":"*Shift*"},{"layer":"shift","id":"K_7","text":"\u060C"},{"width":"140","id":"K_LOPT","sp":"1","text":"*Menu*"},{"width":"415","id":"K_SPACE"},{"id":"U_200C","text":this._v>13?"*ZWNJ*":"<|>"},{"id":"K_PERIOD","text":"."},{"width":"145","id":"K_ENTER","sp":"1","text":"*Enter*"}]}]},{"id":"shift","row":[{"id":"1","key":[{"id":"K_1","text":"\u06F1"},{"id":"K_2","text":"\u06F2"},{"id":"K_3","text":"\u06F3"},{"id":"K_4","text":"\u06F4"},{"id":"K_5","text":"\u06F5"},{"id":"K_6","text":"\u06F6"},{"id":"K_7","text":"\u06F7"},{"id":"K_8","text":"\u06F8"},{"id":"K_9","text":"\u06F9"},{"id":"K_0","text":"\u06F0"},{"id":"K_HYPHEN","text":"-"},{"id":"K_EQUAL","text":"="}]},{"id":"2","key":[{"id":"K_Q","text":"\u0652"},{"id":"K_W","text":"\u064C"},{"id":"K_E","text":"\u064D"},{"id":"K_R","text":"\u064B"},{"id":"K_T","text":"\u064F"},{"id":"K_Y","text":"\u0650"},{"id":"K_U","text":"\u064E"},{"id":"K_I","text":"\u0651"},{"id":"K_O","text":"]"},{"id":"K_P","text":"["},{"id":"K_LBRKT","text":"}"},{"id":"K_RBRKT","text":"{"}]},{"id":"3","key":[{"id":"K_A","text":"\u0624"},{"id":"K_S","text":"\u0626"},{"id":"K_D","text":"\u064A"},{"id":"K_F","text":"\u0625"},{"id":"K_G","text":"\u0623"},{"id":"K_H","text":"\u0622"},{"id":"K_J","text":"\u0629"},{"id":"K_K","text":"\u00BB"},{"id":"K_L","text":"\u00AB"},{"id":"K_COLON","text":":"},{"id":"K_QUOTE","text":"\u061B"},{"id":"K_BKSLASH","text":"|"}]},{"id":"4","key":[{"id":"K_oE2"},{"id":"K_Z","text":"\u0643"},{"id":"K_X","text":"\u0637"},{"id":"K_C","text":"\u0698"},{"id":"K_V","text":"\u0670"},{"id":"K_B","text":"\u200C"},{"id":"K_N","text":"\u0654"},{"id":"K_M","text":"\u0621"},{"id":"K_COMMA","text":">"},{"id":"K_PERIOD","text":"<"},{"id":"K_SLASH","text":"\u061F"},{"width":"100","id":"K_BKSP","sp":"1","text":"*BkSp*"}]},{"id":"5","key":[{"width":"160","id":"K_SHIFT","sp":"1","text":"*Shift*"},{"width":"140","id":"K_LOPT","sp":"1","text":"*Menu*"},{"layer":"default","width":"875","id":"K_SPACE"},{"width":"145","id":"K_ENTER","sp":"1","text":"*Enter*"}]}]}]},"tablet":{"displayUnderlying":false,"layer":[{"id":"default","row":[{"id":"1","key":[{"id":"K_1","text":"\u06F1"},{"id":"K_2","text":"\u06F2"},{"id":"K_3","text":"\u06F3"},{"id":"K_4","text":"\u06F4"},{"id":"K_5","text":"\u06F5"},{"id":"K_6","text":"\u06F6"},{"id":"K_7","text":"\u06F7"},{"id":"K_8","text":"\u06F8"},{"id":"K_9","text":"\u06F9"},{"id":"K_0","text":"\u06F0"},{"id":"K_HYPHEN","text":"-"},{"id":"K_EQUAL","text":"="},{"width":"100","id":"K_BKSP","sp":"1","text":"*BkSp*"}]},{"id":"2","key":[{"id":"K_Q","pad":"75","text":"\u0636"},{"id":"K_W","text":"\u0635"},{"id":"K_E","text":"\u062B"},{"id":"K_R","text":"\u0642"},{"id":"K_T","text":"\u0641"},{"id":"K_Y","text":"\u063A"},{"id":"K_U","text":"\u0639"},{"id":"K_I","text":"\u0647"},{"id":"K_O","text":"\u062E"},{"id":"K_P","text":"\u062D"},{"id":"K_LBRKT","text":"\u062C"},{"id":"K_RBRKT","text":"\u0686"},{"width":"10","id":"T_new_136","sp":"10"}]},{"id":"3","key":[{"id":"K_BKQUOTE"},{"id":"K_A","text":"\u0634"},{"id":"K_S","text":"\u0633"},{"id":"K_D","text":"\u06CC"},{"id":"K_F","text":"\u0628"},{"id":"K_G","text":"\u0644"},{"id":"K_H","text":"\u0627"},{"id":"K_J","text":"\u062A"},{"id":"K_K","text":"\u0646"},{"id":"K_L","text":"\u0645"},{"id":"K_COLON","text":"\u06A9"},{"id":"K_QUOTE","text":"\u06AF"},{"id":"K_BKSLASH","text":"\\"}]},{"id":"4","key":[{"width":"160","id":"K_SHIFT","sp":"1","text":"*Shift*"},{"id":"K_oE2"},{"id":"K_Z","text":"\u0638"},{"id":"K_X","text":"\u0637"},{"id":"K_C","text":"\u0632"},{"id":"K_V","text":"\u0631"},{"id":"K_B","text":"\u0630"},{"id":"K_N","text":"\u062F"},{"id":"K_M","text":"\u067E"},{"id":"K_COMMA","text":"\u0648"},{"id":"K_PERIOD","text":"."},{"id":"K_SLASH","text":"\/"},{"width":"10","id":"T_new_162","sp":"10"}]},{"id":"5","key":[{"width":"140","id":"K_LOPT","sp":"1","text":"*Menu*"},{"width":"930","id":"K_SPACE"},{"width":"145","id":"K_ENTER","sp":"1","text":"*Enter*"}]}]},{"id":"shift","row":[{"id":"1","key":[{"id":"K_1","text":"!"},{"id":"K_2","text":"\u066C"},{"id":"K_3","text":"\u066B"},{"id":"K_4","text":"\u0631\u06CC\u0627\u0644"},{"id":"K_5","text":"\u066A"},{"id":"K_6","text":"\u00D7"},{"id":"K_7","text":"\u060C"},{"id":"K_8","text":"*"},{"id":"K_9","text":")"},{"id":"K_0","text":"("},{"id":"K_HYPHEN","text":"\u0640"},{"id":"K_EQUAL","text":"+"},{"width":"100","id":"K_BKSP","sp":"1","text":"*BkSp*"}]},{"id":"2","key":[{"id":"K_Q","pad":"75","text":"\u0652"},{"id":"K_W","text":"\u064C"},{"id":"K_E","text":"\u064D"},{"id":"K_R","text":"\u064B"},{"id":"K_T","text":"\u064F"},{"id":"K_Y","text":"\u0650"},{"id":"K_U","text":"\u064E"},{"id":"K_I","text":"\u0651"},{"id":"K_O","text":"]"},{"id":"K_P","text":"["},{"id":"K_LBRKT","text":"}"},{"id":"K_RBRKT","text":"{"},{"width":"10","sp":"10"}]},{"id":"3","key":[{"id":"K_BKQUOTE","text":"~"},{"id":"K_A","text":"\u0624"},{"id":"K_S","text":"\u0626"},{"id":"K_D","text":"\u064A"},{"id":"K_F","text":"\u0625"},{"id":"K_G","text":"\u0623"},{"id":"K_H","text":"\u0622"},{"id":"K_J","text":"\u0629"},{"id":"K_K","text":"\u00BB"},{"id":"K_L","text":"\u00AB"},{"id":"K_COLON","text":":"},{"id":"K_QUOTE","text":"\u061B"},{"id":"K_BKSLASH","text":"|"}]},{"id":"4","key":[{"width":"160","id":"K_SHIFT","sp":"1","text":"*Shift*"},{"id":"K_oE2"},{"id":"K_Z","text":"\u0643"},{"id":"K_X","text":"\u0637"},{"id":"K_C","text":"\u0698"},{"id":"K_V","text":"\u0670"},{"id":"K_B","text":"\u200C"},{"id":"K_N","text":"\u0654"},{"id":"K_M","text":"\u0621"},{"id":"K_COMMA","text":">"},{"id":"K_PERIOD","text":"<"},{"id":"K_SLASH","text":"\u061F"},{"width":"10","sp":"10"}]},{"id":"5","key":[{"width":"140","id":"K_LOPT","sp":"1","text":"*Menu*"},{"width":"930","id":"K_SPACE"},{"width":"145","id":"K_ENTER","sp":"1","text":"*Enter*"}]}]}]}};this.KVER="14.0.276.0";this.gs=function(t,e) {return this.g0(t,e);};this.g0=function(t,e) {var k=KeymanWeb,r=0,m=0;if(k.KKM(e,16400,32)) {if(1){r=m=1;k.KO(0,t,"‌");}}else if(k.KKM(e,16400,49)) {if(1){r=m=1;k.KO(0,t,"!");}}else if(k.KKM(e,16400,222)) {if(1){r=m=1;k.KO(0,t,"؛");}}else if(k.KKM(e,16400,51)) {if(1){r=m=1;k.KO(0,t,"٫");}}else if(k.KKM(e,16400,52)) {if(1){r=m=1;k.KO(0,t,"ریال");}}else if(k.KKM(e,16400,53)) {if(1){r=m=1;k.KO(0,t,"٪");}}else if(k.KKM(e,16400,55)) {if(1){r=m=1;k.KO(0,t,"،");}}else if(k.KKM(e,16384,222)) {if(1){r=m=1;k.KO(0,t,"گ");}}else if(k.KKM(e,16400,57)) {if(1){r=m=1;k.KO(0,t,")");}}else if(k.KKM(e,16400,48)) {if(1){r=m=1;k.KO(0,t,"(");}}else if(k.KKM(e,16400,56)) {if(1){r=m=1;k.KO(0,t,"*");}}else if(k.KKM(e,16400,187)) {if(1){r=m=1;k.KO(0,t,"+");}}else if(k.KKM(e,16384,188)) {if(1){r=m=1;k.KO(0,t,"و");}}else if(k.KKM(e,16384,189)) {if(1){r=m=1;k.KO(0,t,"-");}}else if(k.KKM(e,16384,190)) {if(1){r=m=1;k.KO(0,t,".");}}else if(k.KKM(e,16384,191)) {if(1){r=m=1;k.KO(0,t,"/");}}else if(k.KKM(e,16384,48)) {if(1){r=m=1;k.KO(0,t,"۰");}}else if(k.KKM(e,16384,49)) {if(1){r=m=1;k.KO(0,t,"۱");}}else if(k.KKM(e,16384,50)) {if(1){r=m=1;k.KO(0,t,"۲");}}else if(k.KKM(e,16384,51)) {if(1){r=m=1;k.KO(0,t,"۳");}}else if(k.KKM(e,16384,52)) {if(1){r=m=1;k.KO(0,t,"۴");}}else if(k.KKM(e,16384,53)) {if(1){r=m=1;k.KO(0,t,"۵");}}else if(k.KKM(e,16384,54)) {if(1){r=m=1;k.KO(0,t,"۶");}}else if(k.KKM(e,16384,55)) {if(1){r=m=1;k.KO(0,t,"۷");}}else if(k.KKM(e,16384,56)) {if(1){r=m=1;k.KO(0,t,"۸");}}else if(k.KKM(e,16384,57)) {if(1){r=m=1;k.KO(0,t,"۹");}}else if(k.KKM(e,16400,186)) {if(1){r=m=1;k.KO(0,t,":");}}else if(k.KKM(e,16384,186)) {if(1){r=m=1;k.KO(0,t,"ک");}}else if(k.KKM(e,16400,188)) {if(1){r=m=1;k.KO(0,t,">");}}else if(k.KKM(e,16384,187)) {if(1){r=m=1;k.KO(0,t,"=");}}else if(k.KKM(e,16400,190)) {if(1){r=m=1;k.KO(0,t,"<");}}else if(k.KKM(e,16400,191)) {if(1){r=m=1;k.KO(0,t,"؟");}}else if(k.KKM(e,16400,50)) {if(1){r=m=1;k.KO(0,t,"٬");}}else if(k.KKM(e,16400,65)) {if(1){r=m=1;k.KO(0,t,"ؤ");}}else if(k.KKM(e,16400,66)) {if(1){r=m=1;k.KO(0,t,"‌");}}else if(k.KKM(e,16400,67)) {if(1){r=m=1;k.KO(0,t,"ژ");}}else if(k.KKM(e,16400,68)) {if(1){r=m=1;k.KO(0,t,"ي");}}else if(k.KKM(e,16400,69)) {if(1){r=m=1;k.KO(0,t,"ٍ");}}else if(k.KKM(e,16400,70)) {if(1){r=m=1;k.KO(0,t,"إ");}}else if(k.KKM(e,16400,71)) {if(1){r=m=1;k.KO(0,t,"أ");}}else if(k.KKM(e,16400,72)) {if(1){r=m=1;k.KO(0,t,"آ");}}else if(k.KKM(e,16400,73)) {if(1){r=m=1;k.KO(0,t,"ّ");}}else if(k.KKM(e,16400,74)) {if(1){r=m=1;k.KO(0,t,"ݩ");}}else if(k.KKM(e,16400,75)) {if(1){r=m=1;k.KO(0,t,"»");}}else if(k.KKM(e,16400,76)) {if(1){r=m=1;k.KO(0,t,"«");}}else if(k.KKM(e,16400,77)) {if(1){r=m=1;k.KO(0,t,"ۉ");}}else if(k.KKM(e,16400,78)) {if(1){r=m=1;k.KO(0,t,"ٔ");}}else if(k.KKM(e,16400,79)) {if(1){r=m=1;k.KO(0,t,"]");}}else if(k.KKM(e,16400,80)) {if(1){r=m=1;k.KO(0,t,"[");}}else if(k.KKM(e,16400,81)) {if(1){r=m=1;k.KO(0,t,"ْ");}}else if(k.KKM(e,16400,82)) {if(1){r=m=1;k.KO(0,t,"ً");}}else if(k.KKM(e,16400,83)) {if(1){r=m=1;k.KO(0,t,"ئ");}}else if(k.KKM(e,16400,84)) {if(1){r=m=1;k.KO(0,t,"ُ");}}else if(k.KKM(e,16400,85)) {if(1){r=m=1;k.KO(0,t,"َ");}}else if(k.KKM(e,16400,86)) {if(1){r=m=1;k.KO(0,t,"ٰ");}}else if(k.KKM(e,16400,87)) {if(1){r=m=1;k.KO(0,t,"ٌ");}}else if(k.KKM(e,16400,88)) {if(1){r=m=1;k.KO(0,t,"ې");}}else if(k.KKM(e,16400,89)) {if(1){r=m=1;k.KO(0,t,"ِ");}}else if(k.KKM(e,16400,90)) {if(1){r=m=1;k.KO(0,t,"ك");}}else if(k.KKM(e,16384,219)) {if(1){r=m=1;k.KO(0,t,"ج");}}else if(k.KKM(e,16384,220)) {if(1){r=m=1;k.KO(0,t,"\\");}}else if(k.KKM(e,16384,221)) {if(1){r=m=1;k.KO(0,t,"چ");}}else if(k.KKM(e,16400,54)) {if(1){r=m=1;k.KO(0,t,"×");}}else if(k.KKM(e,16400,189)) {if(1){r=m=1;k.KO(0,t,"ـ");}}else if(k.KKM(e,16384,65)) {if(1){r=m=1;k.KO(0,t,"ش");}}else if(k.KKM(e,16384,66)) {if(1){r=m=1;k.KO(0,t,"ذ");}}else if(k.KKM(e,16384,67)) {if(1){r=m=1;k.KO(0,t,"ز");}}else if(k.KKM(e,16384,68)) {if(1){r=m=1;k.KO(0,t,"ی");}}else if(k.KKM(e,16384,69)) {if(1){r=m=1;k.KO(0,t,"ث");}}else if(k.KKM(e,16384,70)) {if(1){r=m=1;k.KO(0,t,"ب");}}else if(k.KKM(e,16384,71)) {if(1){r=m=1;k.KO(0,t,"ل");}}else if(k.KKM(e,16384,72)) {if(1){r=m=1;k.KO(0,t,"ا");}}else if(k.KKM(e,16384,73)) {if(1){r=m=1;k.KO(0,t,"ه");}}else if(k.KKM(e,16384,74)) {if(1){r=m=1;k.KO(0,t,"ت");}}else if(k.KKM(e,16384,75)) {if(1){r=m=1;k.KO(0,t,"ن");}}else if(k.KKM(e,16384,76)) {if(1){r=m=1;k.KO(0,t,"م");}}else if(k.KKM(e,16384,77)) {if(1){r=m=1;k.KO(0,t,"پ");}}else if(k.KKM(e,16384,78)) {if(1){r=m=1;k.KO(0,t,"د");}}else if(k.KKM(e,16384,79)) {if(1){r=m=1;k.KO(0,t,"خ");}}else if(k.KKM(e,16384,80)) {if(1){r=m=1;k.KO(0,t,"ح");}}else if(k.KKM(e,16384,81)) {if(1){r=m=1;k.KO(0,t,"ض");}}else if(k.KKM(e,16384,82)) {if(1){r=m=1;k.KO(0,t,"ق");}}else if(k.KKM(e,16384,83)) {if(1){r=m=1;k.KO(0,t,"س");}}else if(k.KKM(e,16384,84)) {if(1){r=m=1;k.KO(0,t,"ف");}}else if(k.KKM(e,16384,85)) {if(1){r=m=1;k.KO(0,t,"ع");}}else if(k.KKM(e,16384,86)) {if(1){r=m=1;k.KO(0,t,"ر");}}else if(k.KKM(e,16384,87)) {if(1){r=m=1;k.KO(0,t,"ص");}}else if(k.KKM(e,16384,88)) {if(1){r=m=1;k.KO(0,t,"ط");}}else if(k.KKM(e,16384,89)) {if(1){r=m=1;k.KO(0,t,"غ");}}else if(k.KKM(e,16384,90)) {if(1){r=m=1;k.KO(0,t,"ظ");}}else if(k.KKM(e,16400,219)) {if(1){r=m=1;k.KO(0,t,"}");}}else if(k.KKM(e,16400,220)) {if(1){r=m=1;k.KO(0,t,"|");}}else if(k.KKM(e,16400,221)) {if(1){r=m=1;k.KO(0,t,"{");}}else if(k.KKM(e,16400,192)) {if(1){r=m=1;k.KO(0,t,"~");}}return r;};} diff --git a/web/testing/empty-row/empty_row-1.0.js b/web/testing/empty-row/empty_row-1.0.js new file mode 100644 index 0000000000..58c62cb6bb --- /dev/null +++ b/web/testing/empty-row/empty_row-1.0.js @@ -0,0 +1,522 @@ +KeymanWeb.KR(new Keyboard_empty_row()); + +function Keyboard_empty_row() { + this.KI = "Keyboard_empty_row"; + this.KN = "empty row"; + this.KMINVER = "9.0"; + this.KV = null; + this.KDU = 0; + this.KH = ''; + this.KM = 0; + this.KBVER = "1.0"; + this.KMBM = 0x0000; + this.KVKL = { + "phone": { + "font": "Tahoma", + "displayUnderlying": false, + "layer": [{ + "id": "default", + "row": [{ + "id": "1", + "key": [] + }, { + "id": "2", + "key": [{ + "id": "K_Q", + "text": "q" + }, { + "id": "K_W", + "text": "w" + }, { + "id": "K_E", + "text": "e" + }, { + "id": "K_R", + "text": "r" + }, { + "id": "K_T", + "text": "t" + }, { + "id": "K_Y", + "text": "y" + }, { + "id": "K_U", + "text": "u" + }, { + "id": "K_I", + "text": "i" + }, { + "id": "K_O", + "text": "o" + }, { + "id": "K_P", + "text": "p" + }] + }, { + "id": "3", + "key": [{ + "id": "K_A", + "pad": "50", + "text": "a" + }, { + "id": "K_S", + "text": "s" + }, { + "id": "K_D", + "text": "d" + }, { + "id": "K_F", + "text": "f" + }, { + "id": "K_G", + "text": "g" + }, { + "id": "K_H", + "text": "h" + }, { + "id": "K_J", + "text": "j" + }, { + "id": "K_K", + "text": "k" + }, { + "id": "K_L", + "text": "l" + }, { + "width": "10", + "id": "T_new_88", + "sp": "10" + }] + }, { + "id": "4", + "key": [{ + "nextlayer": "shift", + "id": "K_SHIFT", + "sp": "1", + "text": "*Shift*" + }, { + "id": "K_Z", + "text": "z" + }, { + "id": "K_X", + "text": "x" + }, { + "id": "K_C", + "text": "c" + }, { + "id": "K_V", + "text": "v" + }, { + "id": "K_B", + "text": "b" + }, { + "id": "K_N", + "text": "n" + }, { + "id": "K_M", + "text": "m" + }, { + "id": "K_PERIOD", + "text": ".", + "sk": [{ + "id": "K_COMMA", + "text": "," + }, { + "layer": "shift", + "id": "K_1", + "text": "!" + }, { + "layer": "shift", + "id": "K_SLASH", + "text": "?" + }, { + "id": "K_QUOTE", + "text": "'" + }, { + "layer": "shift", + "id": "K_QUOTE", + "text": "\"" + }, { + "id": "K_BKSLASH", + "text": "\\" + }, { + "layer": "shift", + "id": "K_COLON", + "text": ":" + }, { + "id": "K_COLON", + "text": ";" + }] + }, { + "width": "100", + "id": "K_BKSP", + "sp": "1", + "text": "*BkSp*" + }] + }, { + "id": "5", + "key": [{ + "nextlayer": "numeric", + "width": "150", + "id": "K_NUMLOCK", + "sp": "1", + "text": "*123*" + }, { + "width": "120", + "id": "K_LOPT", + "sp": "1", + "text": "*Menu*" + }, { + "width": "610", + "id": "K_SPACE" + }, { + "width": "150", + "id": "K_ENTER", + "sp": "1", + "text": "*Enter*" + }] + }] + }, { + "id": "shift", + "row": [{ + "id": "1", + "key": [{ + "id": "K_Q", + "text": "Q" + }, { + "id": "K_W", + "text": "W" + }, { + "id": "K_E", + "text": "E" + }, { + "id": "K_R", + "text": "R" + }, { + "id": "K_T", + "text": "T" + }, { + "id": "K_Y", + "text": "Y" + }, { + "id": "K_U", + "text": "U" + }, { + "id": "K_I", + "text": "I" + }, { + "id": "K_O", + "text": "O" + }, { + "id": "K_P", + "text": "P" + }] + }, { + "id": "2" + }, { + "id": "3", + "key": [{ + "id": "K_A", + "pad": "50", + "text": "A" + }, { + "id": "K_S", + "text": "S" + }, { + "id": "K_D", + "text": "D" + }, { + "id": "K_F", + "text": "F" + }, { + "id": "K_G", + "text": "G" + }, { + "id": "K_H", + "text": "H" + }, { + "id": "K_J", + "text": "J" + }, { + "id": "K_K", + "text": "K" + }, { + "id": "K_L", + "text": "L" + }, { + "width": "10", + "id": "T_new_122", + "sp": "10" + }] + }, { + "id": "4", + "key": [{ + "nextlayer": "default", + "id": "K_SHIFT", + "sp": "2", + "text": "*Shift*" + }, { + "id": "K_Z", + "text": "Z" + }, { + "id": "K_X", + "text": "X" + }, { + "id": "K_C", + "text": "C" + }, { + "id": "K_V", + "text": "V" + }, { + "id": "K_B", + "text": "B" + }, { + "id": "K_N", + "text": "N" + }, { + "id": "K_M", + "text": "M" + }, { + "layer": "default", + "id": "K_PERIOD", + "text": ".", + "sk": [{ + "layer": "default", + "id": "K_COMMA", + "text": "," + }, { + "layer": "shift", + "id": "K_1", + "text": "!" + }, { + "layer": "shift", + "id": "K_SLASH", + "text": "?" + }, { + "layer": "default", + "id": "K_QUOTE", + "text": "'" + }, { + "layer": "shift", + "id": "K_QUOTE", + "text": "\"" + }, { + "layer": "default", + "id": "K_BKSLASH", + "text": "\\" + }, { + "layer": "shift", + "id": "K_COLON", + "text": ":" + }, { + "layer": "default", + "id": "K_COLON", + "text": ";" + }] + }, { + "id": "K_BKSP", + "sp": "1", + "text": "*BkSp*" + }] + }, { + "id": "5", + "key": [{ + "nextlayer": "numeric", + "width": "150", + "id": "K_NUMLOCK", + "sp": "1", + "text": "*123*" + }, { + "width": "120", + "id": "K_LOPT", + "sp": "1", + "text": "*Menu*" + }, { + "width": "610", + "id": "K_SPACE" + }, { + "width": "150", + "id": "K_ENTER", + "sp": "1", + "text": "*Enter*" + }] + }] + }, { + "id": "numeric", + "row": [{ + "id": "1", + "key": [{ + "id": "K_1", + "text": "1" + }, { + "id": "K_2", + "text": "2" + }, { + "id": "K_3", + "text": "3" + }, { + "id": "K_4", + "text": "4" + }, { + "id": "K_5", + "text": "5" + }, { + "id": "K_6", + "text": "6" + }, { + "id": "K_7", + "text": "7" + }, { + "id": "K_8", + "text": "8" + }, { + "id": "K_9", + "text": "9" + }, { + "id": "K_0", + "text": "0" + }] + }, { + "id": "2", + "key": [{ + "layer": "shift", + "id": "K_4", + "pad": "50", + "text": "$" + }, { + "layer": "shift", + "id": "K_2", + "text": "@" + }, { + "layer": "shift", + "id": "K_3", + "text": "#" + }, { + "layer": "shift", + "id": "K_5", + "text": "%" + }, { + "layer": "shift", + "id": "K_7", + "text": "&" + }, { + "layer": "shift", + "id": "K_HYPHEN", + "text": "_" + }, { + "layer": "default", + "id": "K_EQUAL", + "text": "=" + }, { + "layer": "shift", + "id": "K_BKSLASH", + "text": "|" + }, { + "layer": "default", + "id": "K_BKSLASH", + "text": "\\" + }, { + "width": "10", + "id": "T_new_156", + "sp": "10" + }] + }, { + "id": "3" + }, { + "id": "4", + "key": [{ + "id": "K_LBRKT", + "pad": "110", + "text": "[", + "sk": [{ + "id": "U_00AB", + "text": "\u00AB" + }, { + "layer": "shift", + "id": "K_COMMA", + "text": "<" + }, { + "layer": "shift", + "id": "K_LBRKT", + "text": "{" + }] + }, { + "layer": "shift", + "id": "K_9", + "text": "(" + }, { + "layer": "shift", + "id": "K_0", + "text": ")" + }, { + "id": "K_RBRKT", + "text": "]", + "sk": [{ + "id": "U_00BB", + "text": "\u00BB" + }, { + "layer": "shift", + "id": "K_PERIOD", + "text": ">" + }, { + "layer": "shift", + "id": "K_RBRKT", + "text": "}" + }] + }, { + "layer": "shift", + "id": "K_EQUAL", + "text": "+" + }, { + "id": "K_HYPHEN", + "text": "-" + }, { + "layer": "shift", + "id": "K_8", + "text": "*" + }, { + "id": "K_SLASH", + "text": "\/" + }, { + "width": "100", + "id": "K_BKSP", + "sp": "1", + "text": "*BkSp*" + }] + }, { + "id": "5", + "key": [{ + "nextlayer": "default", + "width": "150", + "id": "K_LOWER", + "sp": "1", + "text": "*abc*" + }, { + "width": "120", + "id": "K_LOPT", + "sp": "1", + "text": "*Menu*" + }, { + "width": "610", + "id": "K_SPACE" + }, { + "width": "150", + "id": "K_ENTER", + "sp": "1", + "text": "*Enter*" + }] + }] + }] + } + }; + this.KVER = "13.0.118.0"; + this.gs = function(t, e) { + return this.g0(t, e); + }; + this.g0 = function(t, e) { + var k = KeymanWeb, + r = 0, + m = 0; + return r; + }; +} diff --git a/web/testing/empty-row/index.html b/web/testing/empty-row/index.html new file mode 100644 index 0000000000..c53b4dad5e --- /dev/null +++ b/web/testing/empty-row/index.html @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + KeymanWeb Test Page - Empty Row + + + + + + + + + + + + + + + + +

KeymanWeb Sample Page - Empty Row Testing

+

This page is designed to test that the OSK removes empty rows in touch-layout keyboards + so they're not displayed. Refer to issue #5327.

+

The empty_row keyboard is a custom keyboard compiled with Developer 13.0, and contains an empty row in each of the 3 layers.

+

The afghan_turkmen keyboard comes directly from the community site reporting the issue, so disregard that + the shift key does not switch layers. +

+

Load the page in mobile viewport and also check developer console does not have exceptions.

+
+
+ +
+ +

Type in your language in this text area:

+ + +

or in this input field:

+ + +

Return to testing home page

+
+ + + + diff --git a/web/testing/index.html b/web/testing/index.html index 712d921bed..aea24c2fc3 100644 --- a/web/testing/index.html +++ b/web/testing/index.html @@ -26,6 +26,7 @@

Tests the new Attachment/Enablement API functionality

Chirality testing/bootstrapping

Tests option/variable store functionality

+

Tests OSK handling of empty rows

Platform testing

Prediction UI testing

Prediction - robust testing