Files
msime-windows/engine/core/key_event.h
T
fanlusky 5a5dea6b7e feat(japanese): 日语模式禁用 -/= 翻页并用 - 打长音符
日语模式下把 - 让给长音符(ー)输入,同时禁掉 -/= 的候选翻页:

- 罗马字方案接受 VK_OEM_MINUS,set_raw_input 不再把 - 过滤掉;
  罗马字表里本来就有 - 到 ー 的条目,只缺按键准入。
- n 后面接 - 时按辅音处理,让前面的 n 收成 ん,避免 n- 卡在 pending。
- 空编码时单独按 - 也起头组合,候选框第一项是 ー、第二项是普通 -。
- 组词流程同样适用:判据只看日语模式加组合状态,不再走翻页和词转字。
- -/= 在日语模式下不翻页,_ = + 这些没有假名写法的字符退回标点上屏,
  并把 = _ 补进服务端的标点集合,和 TSF 侧保持一致,否则会等不到回包。

TSF 侧的影子分类、IsVirtualKeyNeed(ForFreshComposition) 和服务端按键策略
三处同时改,统一以配置项 input_mode == japanese 为判据(R 模式不在范围内,
TSF 侧看不到临时会话,用会话类型判断会让两侧分类打架)。
2026-09-15 01:57:50 +08:00

29 lines
703 B
C++

#pragma once
#include <cstdint>
#ifdef _WIN32
#include <Windows.h>
using ImeKeyCode = UINT;
using ImeModifierMask = UINT;
using ImeCharacter = WCHAR;
#else
using ImeKeyCode = std::uint32_t;
using ImeModifierMask = std::uint32_t;
using ImeCharacter = char16_t;
#endif
namespace ImeKey
{
inline constexpr ImeKeyCode Backspace = 0x08;
inline constexpr ImeKeyCode Tab = 0x09;
inline constexpr ImeKeyCode Return = 0x0D;
inline constexpr ImeKeyCode Shift = 0x10;
inline constexpr ImeKeyCode Escape = 0x1B;
inline constexpr ImeKeyCode Space = 0x20;
inline constexpr ImeKeyCode Semicolon = 0xBA;
inline constexpr ImeKeyCode Minus = 0xBD;
inline constexpr ImeKeyCode Apostrophe = 0xDE;
} // namespace ImeKey