Commit d1abab21 authored by Naoaki Iwakiri's avatar Naoaki Iwakiri

candidate selection key config

parent 6a6eddb7
......@@ -52,5 +52,15 @@ Type=Boolean
Description=Show Annotation
DefaultValue=True
[General/CandidateChooseKey]
Type=Enum
Description=Keys to Select from Candidate Window
EnumCount=3
Enum0=Digit (0,1,2,...)
Enum1=ABC (a,b,c,...)
Enum2=Qwerty Center Row (a,s,d,...)
DefaultValue=Digit (0,1,2,...)
[DescriptionFile]
LocaleDomain=fcitx-skk
......@@ -27,4 +27,5 @@ CONFIG_BINDING_REGISTER("General", "CandidateLayout", candidateLayout)
CONFIG_BINDING_REGISTER("General", "NTriggersToShowCandWin", nTriggersToShowCandWin)
CONFIG_BINDING_REGISTER("General", "ShowAnnotation", showAnnotation)
CONFIG_BINDING_REGISTER("General", "EggLikeNewLine", eggLikeNewLine)
CONFIG_BINDING_REGISTER("General", "CandidateChooseKey", candidateChooseKey) /* candidate selection keys */
CONFIG_BINDING_END()
......@@ -630,7 +630,20 @@ FcitxSkkGetCandWords(void *arg)
FcitxInputState* input = FcitxInstanceGetInputState(skk->owner);
FcitxCandidateWordList* candList = FcitxInputStateGetCandidateList(input);
SkkCandidateList* skkCandList = skk_context_get_candidates(skk->context);
FcitxCandidateWordSetChoose(candList, DIGIT_STR_CHOOSE);
switch (skk->config.candidateChooseKey){
case ChooseABCD:
FcitxCandidateWordSetChoose(candList, ABCD_STR_CHOOSE);
break;
case ChooseASDF:
FcitxCandidateWordSetChoose(candList, ASDF_STR_CHOOSE);
break;
case ChooseDigit:
// FALL THRU
default:
FcitxCandidateWordSetChoose(candList, DIGIT_STR_CHOOSE);
break;
}
FcitxCandidateWordSetPageSize(candList, skk->config.pageSize);
FcitxCandidateWordSetLayoutHint(candList, skk->config.candidateLayout);
......
......@@ -33,6 +33,15 @@
#define _(x) dgettext("fcitx-skk", x)
#define N_(x) (x)
#define ABCD_STR_CHOOSE "abcdefghij"
#define ASDF_STR_CHOOSE "asdfghjkl;"
typedef enum _FcitxSkkChooseKeyType {
ChooseDigit,
ChooseABCD,
ChooseASDF
} FcitxSkkChooseKeyType;
typedef struct _FcitxSkkConfig {
FcitxGenericConfig gconfig;
SkkPeriodStyle punctuationStyle;
......@@ -42,6 +51,7 @@ typedef struct _FcitxSkkConfig {
int pageSize;
boolean showAnnotation;
boolean eggLikeNewLine;
FcitxSkkChooseKeyType candidateChooseKey;
} FcitxSkkConfig;
typedef struct {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment