Skip to content

Commit

Permalink
Added support for inputing Devnagari numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
Parajulibkrm committed Jan 4, 2024
1 parent bb7452d commit 52defb2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions GoogleInputTools/GoogleInputToolsController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -308,4 +311,4 @@ class GoogleInputToolsController: IMKInputController {

return false
}
}
}

0 comments on commit 52defb2

Please sign in to comment.