Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

キーコード自体を最初に入れ替える Keymap 対応 #5

Merged
merged 2 commits into from
Feb 14, 2025

Conversation

tomoemon
Copy link
Owner

Keymap: キーコード to キーコード
KeyboardLayout: キーコード to 英数記号
KeyboardLayout + MozcRule: 英数記号 to キーコード to 文字
Rule: キーコード to 文字

という整理。
配列定義を意味する Rule はすべてキーコードベースで動作する。
一方、Mozc定義では英数記号で配列を定義する。キーコードと英数記号の対応は KeyboardLayout によって決定するので KeyboardLayout によるマッピングが必要。かな系の配列は直接キーコードから文字への対応が行われるので、KeyboardLayout は無くても構わない(とはいえ、通常は英数直接入力への対応が必要なので、KeyboardLayout も必要になる)

Comment on lines +15 to +20
keyEventHandler: (evt: InputEvent) => void,
options?: {
handleKeyDown?: boolean;
handleKeyUp?: boolean;
keyMap?: Map<VirtualKey, VirtualKey>,
}
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyMap を追加するにあたって、onKeyDown + keyMap を指定したい場合にわざわざ onKeyUp に undefined を渡す必要が出てくるため、絶対に必要な keyEventHandler 以外は全部 optional で渡せるようにオブジェクト分割代入形式に変更

@tomoemon tomoemon merged commit eef3327 into main Feb 14, 2025
1 check passed
@tomoemon tomoemon deleted the keymap branch February 14, 2025 12:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant