From 8340899bd83d818a3afbfc2136ba5548b5ee37c3 Mon Sep 17 00:00:00 2001 From: "Amir E. Aharoni" Date: Tue, 24 Sep 2024 14:03:37 -0400 Subject: [PATCH] Add click consonants keyboard Downstream task: https://phabricator.wikimedia.org/T375535 --- rules/mul-click/mul-click-tilde.js | 37 ++++++++++++++++++++++++++++++ src/jquery.ime.inputmethods.js | 8 +++++++ test/jquery.ime.test.fixtures.js | 15 ++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 rules/mul-click/mul-click-tilde.js diff --git a/rules/mul-click/mul-click-tilde.js b/rules/mul-click/mul-click-tilde.js new file mode 100644 index 00000000..118e8673 --- /dev/null +++ b/rules/mul-click/mul-click-tilde.js @@ -0,0 +1,37 @@ +( function ( $ ) { + 'use strict'; + + var clickTilde = { + id: 'mul-click-tilde', + name: 'Click tilde', + description: 'Click input keyboard', + date: '2024-09-24', + URL: 'https://github.com/wikimedia/jquery.ime', + author: 'Amir E. Aharoni', + license: 'GPLv3', + version: '1.0', + patterns: [ + // Typing based on shape + [ '~o', 'ʘ' ], // U+0298: Bilabial click + [ '~1', 'ǀ' ], // U+01C0: Dental click (tilde + 1 => not a pipe) + [ 'ǀ1', 'ǁ' ], // U+01C1: Lateral click (not a pipe + 1 => double pipe) + [ '~=', 'ǂ' ], // U+01C2: Alveolar click + [ '~#', 'ǂ' ], // U+01C2: Alveolar click + [ '~!', 'ǃ' ], // U+01C3: Retroflex click (tilde + exclamation point => not an exclamation point) + [ '~,', '𝼊' ], // U+1DF0A: Retroflex click with retroflex hook + + // Typing based on Zulu and Xhosa orthography + [ '~c', 'ǀ' ], // U+01C0: Dental click (not a pipe!) + [ '~x', 'ǁ' ], // U+01C1: Lateral click + [ '~q', 'ǃ' ], // U+01C3: Retroflex click (not an exclamation point!) + + [ '~\\\\', '\u0300' ], // Combining grave + [ '~/', '\u0301' ], // Combining acute + [ '~\\^', '\u0302' ], // Combining circumflex + [ '~\\{', '\u0303' ], // Combining tilde + [ '~-', '\u0304' ] // Combining macron + ] + }; + + $.ime.register( clickTilde ); +}( jQuery ) ); diff --git a/src/jquery.ime.inputmethods.js b/src/jquery.ime.inputmethods.js index 9ccab726..5ddeda0f 100755 --- a/src/jquery.ime.inputmethods.js +++ b/src/jquery.ime.inputmethods.js @@ -654,6 +654,10 @@ name: 'Burkina Faso tilde keyboard', source: 'rules/mul-bf/mul-bf.js' }, + 'mul-click-tilde': { + name: 'Click consonants keyboard', + source: 'rules/mul-click/mul-click-tilde.js' + }, 'mul-cm': { name: 'General Alphabet of Cameroon Languages tilde keyboard', source: 'rules/mul-cm/mul-cm.js' @@ -1478,6 +1482,10 @@ autonym: 'မြန်မာ', inputmethods: [ 'my-mm3', 'my-xkb' ] }, + naq: { + autonym: 'Khoekhoegowab', + inputmethods: [ 'mul-click-tilde' ] + }, nb: { autonym: 'Norsk (bokmål)', inputmethods: [ 'nb-normforms', 'nb-tildeforms' ] diff --git a/test/jquery.ime.test.fixtures.js b/test/jquery.ime.test.fixtures.js index b2a4dabf..603d1ec1 100644 --- a/test/jquery.ime.test.fixtures.js +++ b/test/jquery.ime.test.fixtures.js @@ -4625,6 +4625,21 @@ var palochkaVariants = { { input: 'a~{', output: 'ã', description: 'Burkina Faso tilde keyboard - ã' } ] }, + { + description: 'Click consonant tilde keyboard test', + inputmethod: 'mul-click-tilde', + tests: [ + { input: '~o', output: 'ʘ', description: 'Click consonant tilde keyboard test - ~o -> ʘ' }, + { input: '~1', output: 'ǀ', description: 'Click consonant tilde keyboard test - ~1 -> ǀ' }, + { input: '~11', output: 'ǁ', description: 'Click consonant tilde keyboard test - ~11 -> ǁ' }, + { input: '~=', output: 'ǂ', description: 'Click consonant tilde keyboard test - ~= -> ǂ' }, + { input: '~#', output: 'ǂ', description: 'Click consonant tilde keyboard test - ~# -> ǂ' }, + { input: '~!', output: 'ǃ', description: 'Click consonant tilde keyboard test - ~! -> ǃ' }, + { input: '~,', output: '𝼊', description: 'Click consonant tilde keyboard test - ~, -> 𝼊' }, + { input: 'a~\\a~/a~^a~{a~-', output: 'aaaaa', description: 'Click consonant tilde keyboard test - ' }, + { input: '~c~x~q', output: 'ǀǁǃ', description: 'Click consonant tilde keyboard test - cxq -> ǀǁǃ' } + ] + }, { description: 'General Alphabet of Cameroon Languages tilde keyboard test', inputmethod: 'mul-cm',