KKeyboard Web

A local Khmer input engine and host-adapter layer for browser text fields and structured editors. It accepts phonetic Latin input, Khmer prefixes, loose Unicode sequences, and consonant skeletons, then returns ranked Khmer candidates without sending typed text to a service.

Execution
Local browser runtime
Query forms
Latin aliases, Khmer Unicode, prefixes, skeletons
Candidate sources
Exact, phonetic, prefix, fuzzy, contextual
Completion
Current word by default; next word is opt-in
Host contract
Range replacement and lifecycle subscription
Adapters
React, Tiptap/ProseMirror, Lexical/MDXEditor

One keyboard, many ways to type

KKeyboard is not a strict transliteration table. It reads whatever you type — Latin or Khmer, complete or partial — and suggests the most likely Khmer words as you go.

Fewer keystrokes

Type a few letters, press Enter, and the full Khmer word is inserted. Shown: ខ្ញុំស្រឡាញ់កម្ពុជា (“I love Cambodia”).

Latin abbreviation
Latin abbreviation13 keys instead of 19
Khmer consonant skeleton
Khmer consonant skeleton7 keys instead of 12

Latin phonetic

Type Khmer the way it sounds using Latin letters. No fixed romanization scheme to learn.

  • khnomខ្ញុំ
  • sousdeyសួស្តី

Forgiving spelling

Missing letters and common spelling variants still find the right word.

  • knomខ្ញុំ

Latin abbreviations

Short consonant-only forms such as khm or km expand to full Khmer words.

  • khmខ្ញុំ
  • kmកម្ពុជា

Khmer consonant skeleton

Type only the Khmer consonants and skip subscripts and vowels — KKeyboard fills in the rest.

  • ខញខ្ញុំ
  • កមពកម្ពុជា

Partial & loose Khmer

Incomplete words or Khmer typed in the wrong Unicode order are normalized to the correct form.

  • ខញុំខ្ញុំ

Auto-suggestions

Ranked suggestions appear beside the caret while you type, completing the current word. Next-word prediction can be switched on.

  • sous…សួស្តី
  • ខ្ញុំ …next word (opt-in)

Auto mode detects Latin or Khmer input automatically. You can also lock the mode to Latin, Khmer, or Skeleton, and choose a formal or casual register.

Live Tiptap integration

This editor uses the packaged Khmer runtime, the React controller, and the Tiptap adapter. Candidate selection is committed through editor transactions so formatting and undo remain intact.

Your typing stays in this browser. The demo does not send your text to Somara.

Runtime behavior

The engine owns query interpretation and ranking. The host adapter owns document positions, selection, editor events, and text replacement.

01

Query normalization

Latin text is normalized into phonetic lookup keys. Khmer input is normalized for Unicode order, prefix lookup, and consonant-skeleton matching.

02

Candidate retrieval

The engine combines reviewed aliases, generated phonetic keys, exact and prefix indexes, fuzzy matches, and skeleton matches.

03

Ranking context

Candidate scores can include frequency and a bounded local context model. Register can be automatic, formal, or casual.

04

Commit semantics

Only the active composing range is replaced. Tiptap and Lexical commits use native editor transactions rather than DOM mutation.

05

Keyboard handling

Enter, Tab, number keys, or pointer selection commit a candidate. Escape dismisses suggestions; Space preserves the user’s text.

Web integration

Use the ready-made React input or connect the headless controller to an editor adapter. Runtime data is cached in the browser and typed text is not sent to a service.

@kkeyboard/react

Ready-made input, headless lifecycle hook, and compact candidate popover.

@kkeyboard/tiptap

Maps text offsets to ProseMirror positions and commits with Tiptap transactions.

@kkeyboard/lexical

Commits through Lexical updates and selections; it also supports MDXEditor integrations.

@kkeyboard/core

Matching, ranking, Unicode normalization and input sessions.

@kkeyboard/web

Browser controller, DOM suggestion list and cached runtime loader.

@kkeyboard/data-km

Versioned offline Khmer runtime bundle and context models.

$npm install @kkeyboard/react
khmer-input.tsxTSX
'use client';
import {useState} from 'react';
import {KKeyboardInput} from '@kkeyboard/react';
import '@kkeyboard/react/styles.css';

export function KhmerInput() {
  const [value, setValue] = useState('');
  return (
    <KKeyboardInput
      value={value}
      onChange={(e) => setValue(e.target.value)}
      placeholder="វាយជាខ្មែរ ឬ khnom"
    />
  );
}

Distribution

KKeyboard is free to use but is not open source at this stage. Integration packages and usage terms are available directly from Somara.

Request integration access