From 52defb27b5067df23118834c5edee02080c4dc52 Mon Sep 17 00:00:00 2001 From: Bikram Parajuli Date: Thu, 4 Jan 2024 18:49:54 +0545 Subject: [PATCH] Added support for inputing Devnagari numbers --- GoogleInputTools/GoogleInputToolsController.swift | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/GoogleInputTools/GoogleInputToolsController.swift b/GoogleInputTools/GoogleInputToolsController.swift index 5ff9c3e..37fa5a1 100644 --- a/GoogleInputTools/GoogleInputToolsController.swift +++ b/GoogleInputTools/GoogleInputToolsController.swift @@ -210,13 +210,16 @@ class GoogleInputToolsController: IMKInputController { let keyValue = Int(key.hexDigitValue!) let count = InputContext.shared.candidates.count - if keyValue >= 1 && keyValue <= count { + if (count > 0) && (keyValue > 0) && (keyValue <= count) { InputContext.shared.currentIndex = keyValue - 1 commitCandidate(client: sender) return true } - - return false + else { + InputContext.shared.composeString.append(inputString) + updateCandidatesWindow() + return true + } } else if event.keyCode == kVK_LeftArrow || event.keyCode == kVK_RightArrow { @@ -308,4 +311,4 @@ class GoogleInputToolsController: IMKInputController { return false } -} +} \ No newline at end of file