mole-virtual-keyboard
TypeScript icon, indicating that this package has built-in type declarations

0.2.2 • Public • Published

mole-virtual-keyboard

logo1 logo2

한글 입력이 가능한 웹 전용 가상 키보드입니다.

DEMO

demo

Link

Installation

npm install mole-virtual-keyboard
yarn add mole-virtual-keyboard

Sample Code

import { HangulImeInputWrapper } from "mole-virtual-keyboard";
import { useEffect, useRef } from "react";

let inputWrapper: HangulImeInputWrapper | undefined = undefined;

export default function App() {
  const inputRef = useRef<HTMLInputElement>(null);

  useEffect(() => {
    if (!inputRef.current) return;
    inputWrapper = new HangulImeInputWrapper(inputRef.current);
  }, []);

  return (
    <div className="App">
      <div>
        <span>입력 : </span>
        <input
          ref={inputRef}
          type="text"
          onSelect={() => {
            inputWrapper?.checkChangedSelect();
          }}
        />
      </div>
      <div>
        {"ㄱㄲㄴㄷㄸㄹㅁㅂㅃㅅㅆㅇㅈㅉㅊㅋㅌㅍㅎ".split("").map((val, idx) => {
          return (
            <button
              key={idx}
              onClick={() => {
                inputWrapper?.insert(val);
              }}
            >
              {val}
            </button>
          );
        })}
      </div>
    </div>
  );
}

Related Link

Package Sidebar

Install

npm i mole-virtual-keyboard

Weekly Downloads

19

Version

0.2.2

License

MIT

Unpacked Size

16.7 kB

Total Files

8

Last publish

Collaborators

  • qbin