{"id":24770776,"url":"https://github.com/okamyuji/imestatusdisplay","last_synced_at":"2026-04-20T19:31:44.744Z","repository":{"id":272684050,"uuid":"916928779","full_name":"okamyuji/ImeStatusDisplay","owner":"okamyuji","description":"A TypeScript-based keyboard and IME state monitoring tool that provides real-time visualization of keyboard events and Input Method Editor states across modern browsers.","archived":false,"fork":false,"pushed_at":"2025-01-16T01:03:19.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-08T11:44:14.149Z","etag":null,"topics":["browser-compatibility","development-tools","event-handling","ime-input","input-method-editor","keyboard-events","realtime-monitoring","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/okamyuji.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-15T02:49:31.000Z","updated_at":"2025-01-19T05:13:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"b20ceb82-ed7c-4fc1-9b6c-7b0ba89dd601","html_url":"https://github.com/okamyuji/ImeStatusDisplay","commit_stats":null,"previous_names":["okamyuji/imestatusdisplay"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/okamyuji/ImeStatusDisplay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okamyuji%2FImeStatusDisplay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okamyuji%2FImeStatusDisplay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okamyuji%2FImeStatusDisplay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okamyuji%2FImeStatusDisplay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/okamyuji","download_url":"https://codeload.github.com/okamyuji/ImeStatusDisplay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/okamyuji%2FImeStatusDisplay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32062287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-20T11:35:06.609Z","status":"ssl_error","status_checked_at":"2026-04-20T11:34:48.899Z","response_time":94,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["browser-compatibility","development-tools","event-handling","ime-input","input-method-editor","keyboard-events","realtime-monitoring","typescript"],"created_at":"2025-01-29T03:56:28.412Z","updated_at":"2026-04-20T19:31:44.720Z","avatar_url":"https://github.com/okamyuji.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# キーボードイベント・IME状態リアルタイム表示\n\nこのプロジェクトは、テキスト入力時のキーボードイベントとIME（Input Method Editor）の状態をリアルタイムで表示するWebアプリケーションです。\n\n## 機能\n\n- IMEの状態（ON/OFF）のリアルタイム表示\n    - 定期的な状態チェックによる正確な状態表示\n    - Safari等のブラウザ固有の挙動に対応\n- キーボードイベントのリアルタイム表示\n    - 特殊キー（Enter、Backspace、Delete、Tab）\n    - 矢印キー（上下左右）\n    - 修飾キー（Ctrl、Alt、Meta）との組み合わせ\n    - 通常のキー入力\n    - IMEの開始と確定状態\n- キーイベント情報の自動クリア（3秒後）\n\n## セットアップ\n\n1. 必要な環境\n   - Node.js（TypeScriptをグローバルにインストールする場合）\n   - TypeScript（`npm install -g typescript`）\n\n2. プロジェクトのビルド\n\n   ```bash\n   # TypeScriptのコンパイル\n   tsc js/script.ts\n   ```\n\n3. 実行方法\n   - `index.html` をWebブラウザで開くだけで動作します\n   - ローカルサーバーを使用する場合は、お好みのHTTPサーバーを使用してください\n\n## 実装詳細\n\n### ファイル構成\n\n- `index.html`: メインのHTMLファイル\n- `js/script.ts`: TypeScriptソースコード\n- `js/script.js`: コンパイル後のJavaScriptファイル\n- `tsconfig.json`: TypeScriptの設定ファイル\n\n### イベントハンドリング\n\n1. IME状態の検出\n   - `compositionstart`: IME入力開始時のイベント\n   - `compositionend`: IME入力確定時のイベント\n   - `input`: テキスト入力時のイベント（IMEの状態も検出）\n   - 定期的な状態チェック（100ミリ秒間隔）\n   - 入力タイムスタンプによる状態管理\n\n2. キーボードイベントの検出\n   - `keydown`: キー押下時のイベント\n   - `blur`: フォーカス喪失時のイベント\n   - 以下の状態を検出：\n     - IME入力中（`isComposing`または`key === 'Process'`）\n     - 特殊キー（Enter、Backspace、Delete、Tab）\n     - 矢印キー\n     - 修飾キーとの組み合わせ\n\n### TypeScript実装のポイント\n\n```typescript\n// IME状態の管理\nlet isComposing: boolean = false;\nlet lastInputTime: number = 0;\nconst IME_CHECK_INTERVAL: number = 100;\n\n// 定期的な状態チェック\nsetInterval(() =\u003e {\n  const now = Date.now();\n  if (now - lastInputTime \u003e 500 \u0026\u0026 isComposing) {\n    // IMEの状態を再確認\n    if (!textInput.matches(':has(\u003e *)') \u0026\u0026 !document.activeElement?.matches(':has(\u003e *)')) {\n      isComposing = false;\n      updateIMEStatus('OFF');\n    }\n  }\n}, IME_CHECK_INTERVAL);\n\n// IMEタイプの定義\nconst imeTypes = [\n  'insertCompositionText',\n  'deleteCompositionText',\n  'insertFromComposition',\n  'deleteByComposition'\n];\n\n// イベント処理\nif (inputEvent.inputType \u0026\u0026 imeTypes.indexOf(inputEvent.inputType) !== -1) {\n  isComposing = true;\n  updateIMEStatus('ON');\n}\n```\n\n### UI更新の仕組み\n\n- IME状態とキーイベント情報は別々のラベルで表示\n- キーイベント情報は3秒後に自動的にクリア\n- スタイリングはCSSで管理（フレックスボックスレイアウト使用）\n- タイムスタンプベースの状態管理による正確な表示\n\n## ブラウザ互換性\n\n- モダンブラウザ（Chrome、Firefox、Safari、Edge）で動作確認済み\n- Safari固有のIMEイベント挙動に対応\n- 定期的な状態チェックによりブラウザ間の差異を吸収\n\n## 注意事項\n\n- IMEの状態検出は、ブラウザやIMEの実装によって挙動が異なる場合があります\n- キーイベントの一部は、ブラウザのセキュリティ設定によってブロックされる可能性があります\n- 定期的な状態チェックにより、CPU使用率が若干上昇する可能性があります\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokamyuji%2Fimestatusdisplay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fokamyuji%2Fimestatusdisplay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fokamyuji%2Fimestatusdisplay/lists"}