XKB 编程键盘

XKB 编程键盘

我想创建一个 XKB/symbols 文件,用于在 Processing 中编程(有点像 Java,但不完全一样)。
例如,如果我按Alt-Gr+,W我希望它创建一个 for 循环,即

for(int i = 0; i < ; i++) {

}

然后将光标放在第二个之前;

我之前在 XKB 中做过一些事情,但没有像这样通过按键做多件事。

如果在 XKB 中无法实现,那么任何其他可行的解决方案都是好的。

以下是整个文件,供参考:

default  partial alphanumeric_keys modifier_keys
xkb_symbols "basic" {

    name[Group1]= "Processing";

    //Row 1
    key <TLDE> {    [        exclam,    exclam equal    ]   };//grave to exclam
    key <AE01> {    [             1     ]   };
    key <AE02> {    [             2,    at      ]   };
    key <AE03> {    [             3,    numbersign  ]   };
    key <AE04> {    [             4,    dollar      ]   };
    key <AE05> {    [             5,    percent     ]   };
    key <AE06> {    [             6,    Left p o w parenleft Right comma space parenright Left  ]   };
    key <AE07> {    [             7,    ampersand ampersand ]   };
    key <AE08> {    [             8,    bar bar     ]   };
    key <AE09> {    [             9,    bracketleft ]   };//Switched parenleft  with bracketleft
    key <AE10> {    [             0,    bracketright    ]   };//Switched parenright with bracketright
    key <AE11> {    [     backslash,    underscore  ]   };
    key <AE12> {    [         equal,    equal equal ]   };

    //Row 2
    key <AD01> {    [             q,    Q       ]   };
    key <AD02> {    [             w,    W,      f o r parenleft i n t space i equal 0 semicolon space i space semicolon space i plus plus parenright space braceleft Enter Enter braceright Left Left Left Left Left Left Left Left Left Left Left Left Left    ]   };
    key <AD03> {    [             e,    E,      s w i t c h parenleft parenright space braceleft Enter Enter braceright Left Left Left Left Left Left Left Left,    c a s e space colon Enter space space Enter b r e a k semicolon Enter   ]   };
    key <AD04> {    [             r,    R,      i f parenleft parenright space braceleft Enter Enter braceright Left Left Left Left Left Left Left Left ]   };
    key <AD05> {    [             t,    T,      space equal space space question space space colon space semicolon Left Left Left Left Left Left Left   ]   };
    key <AD06> {    [             y,    Y,      t r u e     ]   };
    key <AD07> {    [             u,    U,      f a l s e   ]   };
    key <AD08> {    [             i,    I,      b a c k g r o u n d parenleft parenright semicolon Enter Left Left Left ]   };
    key <AD09> {    [             o,    O,      s i z e parenleft comma space parenright semicolon Enter Left Left Left Left Left,  f u l l S c r e e n parenleft parenright semicolon Enter    ]   };
    key <AD10> {    [             p,    P       ]   };
    key <AD11> {    [     parenleft,    braceleft   ]   };//Switched bracketleft  with parenleft
    key <AD12> {    [    parenright,    braceright  ]   };//Switched bracketlright with parenright
    key <BKSL> {    [     backslash,    bar     ]   };

    //Row 3
    key <AC01> {    [             a,    A       ]   };
    key <AC02> {    [             s,    S,      v o i d space s e t u p braceleft Enter Enter braceright Up ]   };
    key <AC03> {    [             d,    D,      v o i d space d r a w braceleft Enter Enter braceright Up   ]   };
    key <AC04> {    [             f,    F,      i n t space,        i n t parenleft parenright Left     ]   };
    key <AC05> {    [             g,    G,      S t r i n g space,  s t r parenleft parenright Left     ]   };
    key <AC06> {    [             h,    H,      f l o a t space,    f l o a t parenleft parenright Left ]   };
    key <AC07> {    [             j,    J,      b o o l e a n space ]   };
    key <AC08> {    [             k,    K,      c l a s s space braceleft Enter Enter Enter Enter braceright Up Up Up Left Left Left    ]   };
    key <AC09> {    [             l,    L       ]   };
    key <AC10> {    [     semicolon,    colon       ]   };
    key <AC11> {    [    apostrophe,    quotedbl    ]   };

    //Row 4
    key <AB01> {    [             z,    Z       ]   };
    key <AB02> {    [             x,    X       ]   };
    key <AB03> {    [             c,    C       ]   };
    key <AB04> {    [             v,    V       ]   };
    key <AB05> {    [             b,    B       ]   };
    key <AB06> {    [             n,    N       ]   };
    key <AB07> {    [             m,    M       ]   };
    key <AB08> {    [         comma,    less,       less equal  ]   };
    key <AB09> {    [        period,    greater,    greater equal   ]   };
    key <AB10> {    [         slash,    question    ]   };

};

感谢大家的帮助!

相关内容