mirror of
https://github.com/mii443/mozc.git
synced 2025-08-23 00:25:34 +00:00
Fix build errors.
* Follow-up to cl/730746292 #codehealth PiperOrigin-RevId: 731116201
This commit is contained in:
@ -156,13 +156,13 @@ struct Kana {
|
|||||||
constexpr bool operator<(const Kana &other) const {
|
constexpr bool operator<(const Kana &other) const {
|
||||||
return std::tie(non_shift, shift) < std::tie(other.non_shift, other.shift);
|
return std::tie(non_shift, shift) < std::tie(other.non_shift, other.shift);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Stores a mapping from ASCII to Kana character. For example, ASCII character
|
// Stores a mapping from ASCII to Kana character. For example, ASCII character
|
||||||
// '4' is mapped to Japanese 'Hiragana Letter U' (without Shift modifier) and
|
// '4' is mapped to Japanese 'Hiragana Letter U' (without Shift modifier) and
|
||||||
// 'Hiragana Letter Small U' (with Shift modifier).
|
// 'Hiragana Letter Small U' (with Shift modifier).
|
||||||
// TODO(team): Add kana_map_dv to support Dvoraklayout.
|
// TODO(team): Add kana_map_dv to support Dvoraklayout.
|
||||||
constexpr KanaMap kKanaJpMap = CreateFlatMap<uint, Kana>({
|
constexpr auto kKanaJpMap = CreateFlatMap<uint, Kana>({
|
||||||
{'1', {"ぬ", "ぬ"}},
|
{'1', {"ぬ", "ぬ"}},
|
||||||
{'!', {"ぬ", "ぬ"}},
|
{'!', {"ぬ", "ぬ"}},
|
||||||
{'2', {"ふ", "ふ"}},
|
{'2', {"ふ", "ふ"}},
|
||||||
@ -341,11 +341,12 @@ bool KeyTranslator::Translate(uint keyval, uint keycode, uint modifiers,
|
|||||||
out_event->add_modifier_keys(commands::KeyEvent::CAPS);
|
out_event->add_modifier_keys(commands::KeyEvent::CAPS);
|
||||||
}
|
}
|
||||||
out_event->set_key_code(keyval);
|
out_event->set_key_code(keyval);
|
||||||
} else if (auto it = kIbusModifierMaskMap->find(keyval);
|
} else if (const uint *mask = kIbusModifierMaskMap.FindOrNull(keyval);
|
||||||
it != kIbusModifierMaskMap->end()) {
|
mask != nullptr) {
|
||||||
// Convert Ibus modifier key to mask (e.g. IBUS_Shift_L to IBUS_SHIFT_MASK)
|
// Convert Ibus modifier key to mask (e.g. IBUS_Shift_L to IBUS_SHIFT_MASK)
|
||||||
modifiers |= it->second;
|
modifiers |= *mask;
|
||||||
} else if (const absl::string_view *key = kSpecialKeyMap->FindOrNull(keyval);
|
} else if (const commands::KeyEvent::SpecialKey *key =
|
||||||
|
kSpecialKeyMap.FindOrNull(keyval);
|
||||||
key != nullptr) {
|
key != nullptr) {
|
||||||
out_event->set_special_key(*key);
|
out_event->set_special_key(*key);
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user