1 /* 2 * SPDX-FileCopyrightText: 2017-2017 CSSlayer <wengxt@gmail.com> 3 * 4 * SPDX-License-Identifier: GPL-2.0-or-later 5 * 6 */ 7 #ifndef _FCITX5_ANTHY_CONFIG_H_ 8 #define _FCITX5_ANTHY_CONFIG_H_ 9 10 #include <fcitx-config/configuration.h> 11 #include <fcitx-config/enum.h> 12 #include <fcitx-utils/i18n.h> 13 #include <fcitx/candidatelist.h> 14 15 namespace fcitx { 16 FCITX_CONFIG_ENUM_NAME_WITH_I18N(CandidateLayoutHint, N_("Not Set"), 17 N_("Vertial"), N_("Horizontal")); 18 } 19 20 enum class InputMode { 21 HIRAGANA, 22 KATAKANA, 23 HALF_KATAKANA, 24 LATIN, 25 WIDE_LATIN, 26 LAST 27 }; 28 29 FCITX_CONFIG_ENUM_NAME_WITH_I18N(InputMode, N_("Hiragana"), N_("Katakana"), 30 N_("Half Katakana"), N_("Latin"), 31 N_("Wide Latin")); 32 33 enum class SymbolStyle { 34 JAPANESE, 35 WIDEBRACKET_WIDESLASH, 36 CORNERBRACKET_MIDDLEDOT, 37 CORNERBRACKET_WIDESLASH, 38 LAST 39 }; 40 41 FCITX_CONFIG_ENUM_NAME_WITH_I18N(SymbolStyle, N_("Japanese"), 42 N_("Wide bracket and wide slash"), 43 N_("Corner bracket and Middle Dot"), 44 N_("Corner bracket and wide slash")); 45 46 enum class PeriodCommaStyle { WIDELATIN, LATIN, JAPANESE, WIDELATIN_JAPANESE }; 47 48 FCITX_CONFIG_ENUM_NAME_WITH_I18N(PeriodCommaStyle, N_("Wide latin"), 49 N_("Latin"), N_("Japanese"), 50 N_("Wide latin Japanese")); 51 52 enum class ConversionMode { 53 MULTI_SEGMENT, 54 SINGLE_SEGMENT, 55 MULTI_SEGMENT_IMMEDIATE, 56 SINGLE_SEGMENT_IMMEDIATE 57 }; 58 59 FCITX_CONFIG_ENUM_NAME_WITH_I18N(ConversionMode, N_("Multi segment"), 60 N_("Single segment"), 61 N_("Multi segment immediate"), 62 N_("Single segment immediate")); 63 64 enum class TypingMethod { ROMAJI, KANA, NICOLA }; 65 66 FCITX_CONFIG_ENUM_NAME_WITH_I18N(TypingMethod, N_("Romaji"), N_("Kana"), 67 N_("Nicola")); 68 69 enum class SpaceType { FOLLOWMODE, WIDE }; 70 71 FCITX_CONFIG_ENUM_NAME_WITH_I18N(SpaceType, N_("Follow mode"), N_("Wide")); 72 73 enum class TenKeyType { 74 WIDE, 75 HALF, 76 FOLLOWMODE, 77 }; 78 79 FCITX_CONFIG_ENUM_NAME_WITH_I18N(TenKeyType, N_("Wide"), N_("Half"), 80 N_("Follow mode")); 81 82 struct AnthyKeyProfile { 83 84 fcitx::KeyList hk_CONVERT; 85 fcitx::KeyList hk_PREDICT; 86 // candidates keys 87 fcitx::KeyList hk_CANDIDATES_PAGE_UP; 88 fcitx::KeyList hk_CANDIDATES_PAGE_DOWN; 89 fcitx::KeyList hk_SELECT_FIRST_CANDIDATE; 90 fcitx::KeyList hk_SELECT_LAST_CANDIDATE; 91 fcitx::KeyList hk_SELECT_NEXT_CANDIDATE; 92 fcitx::KeyList hk_SELECT_PREV_CANDIDATE; 93 fcitx::KeyList hk_SELECT_NEXT_CANDIDATE_ALTER; 94 fcitx::KeyList hk_SELECT_PREV_CANDIDATE_ALTER; 95 96 // segment keys 97 fcitx::KeyList hk_SELECT_FIRST_SEGMENT; 98 fcitx::KeyList hk_SELECT_LAST_SEGMENT; 99 fcitx::KeyList hk_SELECT_NEXT_SEGMENT; 100 fcitx::KeyList hk_SELECT_PREV_SEGMENT; 101 fcitx::KeyList hk_SHRINK_SEGMENT; 102 fcitx::KeyList hk_EXPAND_SEGMENT; 103 fcitx::KeyList hk_COMMIT_FIRST_SEGMENT; 104 fcitx::KeyList hk_COMMIT_SELECTED_SEGMENT; 105 fcitx::KeyList hk_COMMIT_FIRST_SEGMENT_REVERSE_LEARN; 106 fcitx::KeyList hk_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN; 107 108 // direct convert keys 109 fcitx::KeyList hk_CONV_CHAR_TYPE_FORWARD; 110 fcitx::KeyList hk_CONV_CHAR_TYPE_BACKWARD; 111 fcitx::KeyList hk_CONV_TO_HIRAGANA; 112 fcitx::KeyList hk_CONV_TO_KATAKANA; 113 fcitx::KeyList hk_CONV_TO_HALF; 114 fcitx::KeyList hk_CONV_TO_HALF_KATAKANA; 115 fcitx::KeyList hk_CONV_TO_LATIN; 116 fcitx::KeyList hk_CONV_TO_WIDE_LATIN; 117 118 // pseudo ascii mode 119 fcitx::KeyList hk_CANCEL_PSEUDO_ASCII_MODE; 120 121 // caret keys 122 fcitx::KeyList hk_MOVE_CARET_FIRST; 123 fcitx::KeyList hk_MOVE_CARET_LAST; 124 fcitx::KeyList hk_MOVE_CARET_FORWARD; 125 fcitx::KeyList hk_MOVE_CARET_BACKWARD; 126 127 // edit keys 128 fcitx::KeyList hk_BACKSPACE; 129 fcitx::KeyList hk_DELETE; 130 fcitx::KeyList hk_COMMIT; 131 fcitx::KeyList hk_COMMIT_REVERSE_LEARN; 132 fcitx::KeyList hk_CANCEL; 133 fcitx::KeyList hk_CANCEL_ALL; 134 fcitx::KeyList hk_INSERT_SPACE; 135 fcitx::KeyList hk_INSERT_ALT_SPACE; 136 fcitx::KeyList hk_INSERT_HALF_SPACE; 137 fcitx::KeyList hk_INSERT_WIDE_SPACE; 138 139 // mode keys 140 fcitx::KeyList hk_CIRCLE_INPUT_MODE; 141 fcitx::KeyList hk_CIRCLE_KANA_MODE; 142 fcitx::KeyList hk_CIRCLE_LATIN_HIRAGANA_MODE; 143 fcitx::KeyList hk_CIRCLE_TYPING_METHOD; 144 fcitx::KeyList hk_LATIN_MODE; 145 fcitx::KeyList hk_WIDE_LATIN_MODE; 146 fcitx::KeyList hk_HIRAGANA_MODE; 147 fcitx::KeyList hk_KATAKANA_MODE; 148 fcitx::KeyList hk_HALF_KATAKANA_MODE; 149 150 // dict keys 151 fcitx::KeyList hk_DICT_ADMIN; 152 fcitx::KeyList hk_ADD_WORD; 153 154 // reconvert 155 fcitx::KeyList hk_RECONVERT; 156 }; 157 158 FCITX_CONFIGURATION( 159 AnthyGeneralConfig, 160 fcitx::Option<int, fcitx::IntConstrain> pageSize{ 161 this, "PageSize", _("Page size"), 10, fcitx::IntConstrain(3, 10)}; 162 fcitx::Option<fcitx::CandidateLayoutHint> candidateLayout{ 163 this, "CandidateLayout", _("Candidate List Layout"), 164 fcitx::CandidateLayoutHint::Vertical}; 165 fcitx::Option<int, fcitx::IntConstrain> nTriggersToShowCandWin{ 166 this, "NTriggersToShowCandWin", 167 _("Number candidate of Triggers To Show Candidate Window"), 2, 168 fcitx::IntConstrain(0, 7)}; 169 fcitx::Option<bool> predictOnInput{this, "PredictOnInput", 170 _("Predict on input"), false}; 171 fcitx::Option<bool> romajiPseudoAsciiBlankBehavior{ 172 this, "RomajiPseudoAsciiBlankBehavior", 173 _("Insert a blank with a blank key"), true}; 174 fcitx::Option<bool> romajiPseudoAsciiMode{ 175 this, "RomajiPseudoAsciiMode", 176 _("Entering the pseudo ASCII input mode with capital letters"), true}; 177 fcitx::Option<bool> romajiHalfSymbol{ 178 this, "RomajiHalfSymbol", _("Use half-width characters for symbols"), 179 true}; 180 fcitx::Option<bool> romajiHalfNumber{ 181 this, "RomajiHalfNumber", _("Use half-width characters for numbers"), 182 true}; 183 fcitx::OptionWithAnnotation<InputMode, InputModeI18NAnnotation> inputMode{ 184 this, "InputMode", _("Input mode"), InputMode::HIRAGANA}; 185 fcitx::OptionWithAnnotation<TypingMethod, TypingMethodI18NAnnotation> 186 typingMethod{this, "TypingMethod", _("Typing method"), 187 TypingMethod::ROMAJI}; 188 fcitx::OptionWithAnnotation<ConversionMode, ConversionModeI18NAnnotation> 189 conversionMode{this, "ConversionMode", _("Conversion mode"), 190 ConversionMode::MULTI_SEGMENT}; 191 fcitx::OptionWithAnnotation<PeriodCommaStyle, 192 PeriodCommaStyleI18NAnnotation> 193 periodCommaStyle{this, "PeriodStyle", _("Period style"), 194 PeriodCommaStyle::JAPANESE}; 195 fcitx::OptionWithAnnotation<SymbolStyle, SymbolStyleI18NAnnotation> 196 symbolStyle{this, "SymbolStyle", _("Symbol style"), 197 SymbolStyle::JAPANESE}; 198 fcitx::OptionWithAnnotation<SpaceType, SpaceTypeI18NAnnotation> spaceType{ 199 this, "SpaceType", _("Space type"), SpaceType::FOLLOWMODE}; 200 fcitx::OptionWithAnnotation<TenKeyType, TenKeyTypeI18NAnnotation> 201 tenKeyType{this, "TenKeyType", _("Ten key type"), 202 TenKeyType::FOLLOWMODE}; 203 fcitx::Option<bool> learnOnManualCommit{this, "LearnOnManualCommit", 204 _("Learn on manual commit"), true}; 205 fcitx::Option<bool> learnOnAutoCommit{this, "LearnOnAutoCommit", 206 _("Learn on auto commit"), true}; 207 fcitx::Option<bool> romajiAllowSplit{this, "AllowSplit", _("Allow split"), 208 true}; 209 fcitx::Option<bool> useDirectKeyOnPredict{ 210 this, "UseDirectKeyOnPredict", _("Use direct key on predict"), true}; 211 fcitx::Option<bool> showCandidatesLabel{this, "ShowCandidatesLabel", 212 _("Show candidates label"), true};); 213 214 FCITX_CONFIGURATION( 215 AnthyInterfaceConfig, 216 fcitx::Option<bool> showInputModeLabel{this, "ShowInputMode", 217 _("Show input mode"), true}; 218 fcitx::Option<bool> showTypingMethodLabel{this, "ShowTypingMethod", 219 _("Show typing method"), true}; 220 fcitx::Option<bool> showConvModeLabel{this, "ShowConversionMode", 221 _("Show conversion mode"), true}; 222 fcitx::Option<bool> showPeriodStyleLabel{this, "ShowPeriodStyle", 223 _("Show period style"), false}; 224 fcitx::Option<bool> showSymbolStyleLabel{ 225 this, "ShowSymbolStyle", _("Show candidates label"), false};); 226 227 enum class KeyBindingProfile { 228 Default, 229 Atok, 230 Canna, 231 MSIME, 232 VjeDelta, 233 WNN, 234 Custom 235 }; 236 FCITX_CONFIG_ENUM_NAME_WITH_I18N(KeyBindingProfile, N_("Default"), N_("Atok"), 237 N_("Canna"), N_("MS IME"), N_("Vje Delta"), 238 N_("WNN"), N_("Custom")); 239 240 enum class RomajiTable { 241 Default, 242 Atok, 243 Azik, 244 Canna, 245 MSIME, 246 VjeDelta, 247 WNN, 248 Custom 249 }; 250 251 FCITX_CONFIG_ENUM_NAME_WITH_I18N(RomajiTable, N_("Default"), N_("Atok"), 252 N_("Azik"), N_("Canna"), N_("MS IME"), 253 N_("Vje Delta"), N_("WNN"), N_("Custom")); 254 255 enum class KanaTable { 256 Default, 257 _101Kana, 258 Tsuki2_203_101, 259 Tsuki2_203_106, 260 QuickKana, 261 Custom, 262 }; 263 264 FCITX_CONFIG_ENUM_NAME_WITH_I18N(KanaTable, N_("Default"), N_("101kana"), 265 N_("tsuki-2-203-101"), N_("tsuki-2-203-106"), 266 N_("Quick Kana"), N_("Custom")); 267 268 enum class NicolaTable { 269 Default, 270 Nicola_A, 271 Nicola_F, 272 Nicola_J, 273 Oasys100J, 274 TronDvorak, 275 TronQwertyJP, 276 Custom 277 }; 278 279 FCITX_CONFIG_ENUM_NAME_WITH_I18N(NicolaTable, N_("Default"), N_("Nicola-A"), 280 N_("Nicola-F"), N_("Nicola-J"), 281 N_("Oasys100J"), N_("Tron Dvorak"), 282 N_("Tron Qwerty JP"), N_("Custom")); 283 284 FCITX_CONFIGURATION( 285 AnthyKeyProfileConfig, 286 fcitx::OptionWithAnnotation<KeyBindingProfile, 287 KeyBindingProfileI18NAnnotation> 288 keyProfileEnum{this, "KeyBindingProfile", _("Key binding profile"), 289 KeyBindingProfile::Default}; 290 fcitx::OptionWithAnnotation<RomajiTable, RomajiTableI18NAnnotation> 291 romajiTableEnum{this, "RomajiTable", _("Romaji Table"), 292 RomajiTable::Default}; 293 fcitx::OptionWithAnnotation<KanaTable, KanaTableI18NAnnotation> 294 kanaTableEnum{this, "KanaTable", _("Kana Table"), KanaTable::Default}; 295 fcitx::OptionWithAnnotation<NicolaTable, NicolaTableI18NAnnotation> 296 nicolaTableEnum{this, "NicolaTable", _("Nicola Table"), 297 NicolaTable::Default}; 298 fcitx::Option<std::string> keyThemeFile{this, "CustomKeyBinding", 299 _("Custom Key Binding")}; 300 fcitx::Option<std::string> romajiFundamentalTable{this, "CustomRomajiTable", 301 _("Custom Romaji Table")}; 302 fcitx::Option<std::string> kanaFundamentalTable{this, "CustomKanaTable", 303 _("Custom Kana Table")}; 304 fcitx::Option<std::string> nicolaFundamentalTable{ 305 this, "CustomNicolaTable", _("Custom Nicola Table")};); 306 307 FCITX_CONFIGURATION( 308 AnthyKeyConfig, 309 fcitx::KeyListOption hk_CIRCLE_INPUT_MODE{ 310 this, 311 "CircleInputModeKey", 312 _("Circle input mode"), 313 {fcitx::Key("Control+comma"), fcitx::Key("Control+less")}, 314 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 315 fcitx::KeyListOption hk_CIRCLE_KANA_MODE{ 316 this, 317 "CircleKanaModeKey", 318 _("Circle kana mode"), 319 {fcitx::Key("Control+period"), fcitx::Key(FcitxKey_Hiragana_Katakana)}, 320 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 321 fcitx::KeyListOption hk_CIRCLE_LATIN_HIRAGANA_MODE{ 322 this, 323 "CircleLatinHiraganaModeKey", 324 _("Circle latin and hiragana mode"), 325 {}, 326 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 327 fcitx::KeyListOption hk_CIRCLE_TYPING_METHOD{ 328 this, 329 "CircleTypingMethodKey", 330 _("Circle typing method"), 331 {fcitx::Key("Alt+Romaji"), fcitx::Key("Control+slash")}, 332 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 333 fcitx::KeyListOption hk_LATIN_MODE{ 334 this, 335 "LatinModeKey", 336 _("Latin mode"), 337 {}, 338 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 339 fcitx::KeyListOption hk_WIDE_LATIN_MODE{ 340 this, 341 "WideLatinModeKey", 342 _("Wide latin mode"), 343 {}, 344 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 345 fcitx::KeyListOption hk_HIRAGANA_MODE{ 346 this, 347 "HiraganaModeKey", 348 _("Hiragana mode"), 349 {}, 350 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 351 fcitx::KeyListOption hk_KATAKANA_MODE{ 352 this, 353 "KatakanaModeKey", 354 _("Katakana mode"), 355 {}, 356 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 357 fcitx::KeyListOption hk_HALF_KATAKANA_MODE{ 358 this, 359 "HalfKatakanaModeKey", 360 _("Half Katakana mode"), 361 {}, 362 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 363 fcitx::KeyListOption hk_CANCEL_PSEUDO_ASCII_MODE{ 364 this, 365 "CancelPseudoAsciiModeKey", 366 _("Cancel pseudo ascii mode"), 367 {fcitx::Key(FcitxKey_Escape)}, 368 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 369 fcitx::KeyListOption hk_INSERT_SPACE{ 370 this, 371 "InsertSpaceKey", 372 _("Insert space"), 373 {fcitx::Key(FcitxKey_space)}, 374 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 375 fcitx::KeyListOption hk_INSERT_ALT_SPACE{ 376 this, 377 "InsertAltSpaceKey", 378 _("Insert Alternative space"), 379 {fcitx::Key("Shift+space")}, 380 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 381 fcitx::KeyListOption hk_INSERT_HALF_SPACE{ 382 this, 383 "InsertHalfSpaceKey", 384 _("Insert Half Space"), 385 {}, 386 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 387 fcitx::KeyListOption hk_INSERT_WIDE_SPACE{ 388 this, 389 "InsertWideSpaceKey", 390 _("Insert wide space"), 391 {}, 392 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 393 fcitx::KeyListOption hk_BACKSPACE{ 394 this, 395 "BackSpaceKey", 396 _("BackSpace"), 397 {fcitx::Key(FcitxKey_BackSpace), fcitx::Key("Control+H")}, 398 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 399 fcitx::KeyListOption hk_DELETE{ 400 this, 401 "DeleteKey", 402 _("Delete"), 403 {fcitx::Key(FcitxKey_Delete), fcitx::Key("Control+D")}, 404 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 405 fcitx::KeyListOption hk_COMMIT{ 406 this, 407 "CommitKey", 408 _("Commit"), 409 {fcitx::Key(FcitxKey_Return), fcitx::Key("Control+J")}, 410 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 411 fcitx::KeyListOption hk_COMMIT_REVERSE_LEARN{ 412 this, 413 "CommitReverseLearnKey", 414 _("Commit Reverse Learn"), 415 {fcitx::Key("Shift+Return")}, 416 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 417 fcitx::KeyListOption hk_CONVERT{ 418 this, 419 "ConvertKey", 420 _("Convert"), 421 {fcitx::Key(FcitxKey_space), fcitx::Key(FcitxKey_Henkan)}, 422 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 423 fcitx::KeyListOption hk_PREDICT{ 424 this, 425 "PredictKey", 426 _("Predict"), 427 {fcitx::Key(FcitxKey_Tab)}, 428 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 429 fcitx::KeyListOption hk_CANCEL{ 430 this, 431 "CancelKey", 432 _("Cancel"), 433 {fcitx::Key(FcitxKey_Escape), fcitx::Key("Control+G")}, 434 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 435 fcitx::KeyListOption hk_CANCEL_ALL{ 436 this, 437 "CancelAllKey", 438 _("Cancel all"), 439 {}, 440 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 441 fcitx::KeyListOption hk_MOVE_CARET_FIRST{ 442 this, 443 "MoveCaretFirstKey", 444 _("Move caret first"), 445 {fcitx::Key("Control+A"), fcitx::Key(FcitxKey_Home)}, 446 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 447 fcitx::KeyListOption hk_MOVE_CARET_LAST{ 448 this, 449 "MoveCaretLastKey", 450 _("Move caret last"), 451 {fcitx::Key("Control+E"), fcitx::Key(FcitxKey_End)}, 452 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 453 fcitx::KeyListOption hk_MOVE_CARET_FORWARD{ 454 this, 455 "MoveCaretForwardKey", 456 _("Move caret forward"), 457 {fcitx::Key("Control+F"), fcitx::Key(FcitxKey_Left)}, 458 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 459 fcitx::KeyListOption hk_MOVE_CARET_BACKWARD{ 460 this, 461 "MoveCaretBackwardKey", 462 _("Move caret backward"), 463 {fcitx::Key("Control+B"), fcitx::Key(FcitxKey_Right)}, 464 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 465 fcitx::KeyListOption hk_SELECT_FIRST_SEGMENT{ 466 this, 467 "SelectFirstSegmentKey", 468 _("Select first segment"), 469 {fcitx::Key("Control+A"), fcitx::Key(FcitxKey_Home)}, 470 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 471 fcitx::KeyListOption hk_SELECT_LAST_SEGMENT{ 472 this, 473 "SelectLastSegmentKey", 474 _("Select last segment"), 475 {fcitx::Key("Control+E"), fcitx::Key(FcitxKey_End)}, 476 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 477 fcitx::KeyListOption hk_SELECT_NEXT_SEGMENT{ 478 this, 479 "SelectNextSegmentKey", 480 _("Select next segment"), 481 {fcitx::Key("Control+F"), fcitx::Key(FcitxKey_Right)}, 482 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 483 fcitx::KeyListOption hk_SELECT_PREV_SEGMENT{ 484 this, 485 "SelectPrevSegmentKey", 486 _("Select prev segment"), 487 {fcitx::Key("Control+B"), fcitx::Key(FcitxKey_Left)}, 488 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 489 fcitx::KeyListOption hk_SHRINK_SEGMENT{ 490 this, 491 "ShrinkSegmentKey", 492 _("Shrink segment"), 493 {fcitx::Key("Shift+Left"), fcitx::Key("Control+I")}, 494 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 495 fcitx::KeyListOption hk_EXPAND_SEGMENT{ 496 this, 497 "ExpandSegmentKey", 498 _("Expand segment"), 499 {fcitx::Key("Shift+Right"), fcitx::Key("Control+O")}, 500 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 501 fcitx::KeyListOption hk_COMMIT_FIRST_SEGMENT{ 502 this, 503 "CommitFirstSegmentKey", 504 _("Commit first segment"), 505 {fcitx::Key("Shift+Down")}, 506 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 507 fcitx::KeyListOption hk_COMMIT_SELECTED_SEGMENT{ 508 this, 509 "CommitSelectedSegmentKey", 510 _("Commit selected segment"), 511 {fcitx::Key("Control+Down")}, 512 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 513 fcitx::KeyListOption hk_COMMIT_FIRST_SEGMENT_REVERSE_LEARN{ 514 this, 515 "CommitFirstSegmentReverseLearnKey", 516 _("Commit first segement reverse learn"), 517 {}, 518 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 519 fcitx::KeyListOption hk_COMMIT_SELECTED_SEGMENT_REVERSE_LEARN{ 520 this, 521 "CommitSelectedSegmentReverseLearnKey", 522 _("Commit selected segement reverse learn"), 523 {}, 524 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 525 fcitx::KeyListOption hk_SELECT_FIRST_CANDIDATE{ 526 this, 527 "SelectFirstCandidateKey", 528 _("Select first candidate"), 529 {fcitx::Key(FcitxKey_Home)}, 530 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 531 fcitx::KeyListOption hk_SELECT_LAST_CANDIDATE{ 532 this, 533 "SelectLastCandidateKey", 534 _("Select last candidate"), 535 {fcitx::Key(FcitxKey_End)}, 536 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 537 fcitx::KeyListOption hk_SELECT_NEXT_CANDIDATE{ 538 this, 539 "SelectNextCandidateKey", 540 _("Select next candidate"), 541 {fcitx::Key(FcitxKey_space), fcitx::Key(FcitxKey_Tab), 542 fcitx::Key(FcitxKey_Henkan), fcitx::Key(FcitxKey_Down)}, 543 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 544 fcitx::KeyListOption hk_SELECT_PREV_CANDIDATE{ 545 this, 546 "SelectPrevCandidateKey", 547 _("Select prev candidate"), 548 {fcitx::Key("Shift+Tab"), fcitx::Key(FcitxKey_Up)}, 549 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 550 fcitx::KeyListOption hk_CANDIDATES_PAGE_UP{ 551 this, 552 "CandidatesPageUpKey", 553 _("Candidates Page Up"), 554 {fcitx::Key(FcitxKey_Page_Up)}, 555 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 556 fcitx::KeyListOption hk_CANDIDATES_PAGE_DOWN{ 557 this, 558 "CandidatesPageDownKey", 559 _("Candidates Page Down"), 560 {fcitx::Key(FcitxKey_Page_Down)}, 561 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 562 fcitx::KeyListOption hk_CONV_CHAR_TYPE_FORWARD{ 563 this, 564 "ConvertCharTypeForwardKey", 565 _("Convert char type forward"), 566 {fcitx::Key(FcitxKey_Muhenkan)}, 567 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 568 fcitx::KeyListOption hk_CONV_CHAR_TYPE_BACKWARD{ 569 this, 570 "ConvertCharTypeBackwardKey", 571 _("Convert char type backward"), 572 {}, 573 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 574 fcitx::KeyListOption hk_CONV_TO_HIRAGANA{ 575 this, 576 "ConvertToHiraganaKey", 577 _("Convert To Hiragana"), 578 {fcitx::Key(FcitxKey_F6)}, 579 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 580 fcitx::KeyListOption hk_CONV_TO_KATAKANA{ 581 this, 582 "ConvertToKatakanaKey", 583 _("Convert To Katakana"), 584 {fcitx::Key(FcitxKey_F7)}, 585 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 586 fcitx::KeyListOption hk_CONV_TO_HALF{ 587 this, 588 "ConvertToHalfKey", 589 _("Convert To Half"), 590 {fcitx::Key(FcitxKey_F8)}, 591 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 592 fcitx::KeyListOption hk_CONV_TO_HALF_KATAKANA{ 593 this, 594 "ConvertToHalfKatakanaKey", 595 _("Convert To Half Katakana"), 596 {fcitx::Key("Shift+F8")}, 597 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 598 fcitx::KeyListOption hk_CONV_TO_WIDE_LATIN{ 599 this, 600 "ConvertToWideLatinKey", 601 _("Convert To Wide Latin"), 602 {fcitx::Key(FcitxKey_F9)}, 603 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 604 fcitx::KeyListOption hk_CONV_TO_LATIN{ 605 this, 606 "ConvertToLatinKey", 607 _("Convert To Latin"), 608 {fcitx::Key(FcitxKey_F10)}, 609 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 610 fcitx::KeyListOption hk_RECONVERT{ 611 this, 612 "ReconvertKey", 613 _("Reconvert"), 614 {fcitx::Key("Shift+Henkan")}, 615 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 616 fcitx::KeyListOption hk_DICT_ADMIN{ 617 this, 618 "DictAdminKey", 619 _("Dict admin"), 620 {fcitx::Key(FcitxKey_F11)}, 621 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 622 fcitx::KeyListOption hk_ADD_WORD{ 623 this, 624 "AddWordKey", 625 _("Add Word"), 626 {fcitx::Key(FcitxKey_F12)}, 627 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 628 fcitx::KeyListOption leftThumbKeys{ 629 this, 630 "LeftThumbKey", 631 _("Left thumb key"), 632 {fcitx::Key(FcitxKey_Muhenkan)}, 633 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 634 fcitx::KeyListOption rightThumbKeys{ 635 this, 636 "RightThumbKey", 637 _("Right thumb key"), 638 {fcitx::Key(FcitxKey_Henkan), fcitx::Key(FcitxKey_space)}, 639 fcitx::KeyListConstrain(fcitx::KeyConstrainFlag::AllowModifierLess)}; 640 fcitx::Option<std::string> kanaLayoutRoKey{ 641 this, "KanaLayoutRoKey", _("Ro key for kana layout"), "ろ"}; 642 fcitx::Option<int> nicolaTime{this, "NicolaTime", _("Nicola time"), 200};); 643 644 FCITX_CONFIGURATION(AnthyCommnadConfig, 645 fcitx::Option<std::string> addWordCommand{ 646 this, "AddWord", _("Add word"), "kasumi -a"}; 647 fcitx::Option<std::string> dictAdminCommand{ 648 this, "DictAdmin", _("Dict admin"), "kasumi"};); 649 650 FCITX_CONFIGURATION( 651 AnthyConfig, 652 fcitx::Option<AnthyGeneralConfig> general{this, "General", _("General")}; 653 fcitx::Option<AnthyInterfaceConfig> interface{this, "Interface", 654 _("Interface")}; 655 fcitx::Option<AnthyKeyProfileConfig> keyProfile{this, "KeyProfile", 656 _("Key Profile")}; 657 fcitx::Option<AnthyKeyConfig> key{this, "Key", _("Key")}; 658 fcitx::Option<AnthyCommnadConfig> command{this, "Command", _("Command")};); 659 660 #endif // _FCITX5_ANTHY_CONFIG_H_ 661