Merge branch 'generate-xkb-files' into 'master'
Generate XKB keymaps from XML instead of using pre-made ones See merge request Librem5/squeekboard!90
This commit is contained in:
@ -3,52 +3,52 @@
|
||||
<bounds x="0" y="10.000000" width="426.0000" height="296.5853"/>
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="24" name="AD01" oref="outline2" />
|
||||
<key keycode="25" name="AD02" oref="outline2" />
|
||||
<key keycode="26" name="AD03" oref="outline2" />
|
||||
<key keycode="27" name="AD04" oref="outline2" />
|
||||
<key keycode="28" name="AD05" oref="outline2" />
|
||||
<key keycode="29" name="AD06" oref="outline2" />
|
||||
<key keycode="30" name="AD07" oref="outline2" />
|
||||
<key keycode="31" name="AD08" oref="outline2" />
|
||||
<key keycode="32" name="AD09" oref="outline2" />
|
||||
<key keycode="33" name="AD10" oref="outline2" />
|
||||
<key name="AD01" oref="outline2" />
|
||||
<key name="AD02" oref="outline2" />
|
||||
<key name="AD03" oref="outline2" />
|
||||
<key name="AD04" oref="outline2" />
|
||||
<key name="AD05" oref="outline2" />
|
||||
<key name="AD06" oref="outline2" />
|
||||
<key name="AD07" oref="outline2" />
|
||||
<key name="AD08" oref="outline2" />
|
||||
<key name="AD09" oref="outline2" />
|
||||
<key name="AD10" oref="outline2" />
|
||||
</row>
|
||||
</section>
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="38" name="AC01" oref="outline2" />
|
||||
<key keycode="39" name="AC02" oref="outline2" />
|
||||
<key keycode="40" name="AC03" oref="outline2" />
|
||||
<key keycode="41" name="AC04" oref="outline2" />
|
||||
<key keycode="42" name="AC05" oref="outline2" />
|
||||
<key keycode="43" name="AC06" oref="outline2" />
|
||||
<key keycode="44" name="AC07" oref="outline2" />
|
||||
<key keycode="45" name="AC08" oref="outline2" />
|
||||
<key keycode="46" name="AC09" oref="outline2" />
|
||||
<key keycode="47" name="AC10" oref="outline2" />
|
||||
<key name="AC01" oref="outline2" />
|
||||
<key name="AC02" oref="outline2" />
|
||||
<key name="AC03" oref="outline2" />
|
||||
<key name="AC04" oref="outline2" />
|
||||
<key name="AC05" oref="outline2" />
|
||||
<key name="AC06" oref="outline2" />
|
||||
<key name="AC07" oref="outline2" />
|
||||
<key name="AC08" oref="outline2" />
|
||||
<key name="AC09" oref="outline2" />
|
||||
<key name="AC10" oref="outline2" />
|
||||
</row>
|
||||
</section>
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="50" name="LFSH" oref="altline" />
|
||||
<key keycode="52" name="AB01" oref="outline2" />
|
||||
<key keycode="53" name="AB02" oref="outline2" />
|
||||
<key keycode="54" name="AB03" oref="outline2" />
|
||||
<key keycode="55" name="AB04" oref="outline2" />
|
||||
<key keycode="56" name="AB05" oref="outline2" />
|
||||
<key keycode="57" name="AB06" oref="outline2" />
|
||||
<key keycode="58" name="AB07" oref="outline2" />
|
||||
<key keycode="22" name="BKSP" oref="altline" />
|
||||
<key name="LFSH" oref="altline" />
|
||||
<key name="AB01" oref="outline2" />
|
||||
<key name="AB02" oref="outline2" />
|
||||
<key name="AB03" oref="outline2" />
|
||||
<key name="AB04" oref="outline2" />
|
||||
<key name="AB05" oref="outline2" />
|
||||
<key name="AB06" oref="outline2" />
|
||||
<key name="AB07" oref="outline2" />
|
||||
<key name="BKSP" oref="altline" />
|
||||
</row>
|
||||
</section>
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="0" name="ABC123" oref="altline" />
|
||||
<key keycode="149" name="I149" oref="altline" />
|
||||
<key keycode="65" name="SPCE" oref="spaceline" />
|
||||
<key keycode="59" name="AB08" oref="outline2" />
|
||||
<key keycode="36" name="RTRN" oref="outline7" />
|
||||
<key name="I149" oref="altline" />
|
||||
<key name="SPCE" oref="spaceline" />
|
||||
<key name="AB08" oref="outline2" />
|
||||
<key name="RTRN" oref="outline7" />
|
||||
</row>
|
||||
</section>
|
||||
<outline id="outline2" corner-radius="1.000000">
|
||||
|
||||
@ -7,54 +7,54 @@
|
||||
values in the range from 8 to 255. -->
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="24" name="AD01" oref="outline2" />
|
||||
<key keycode="25" name="AD02" oref="outline2" />
|
||||
<key keycode="26" name="AD03" oref="outline2" />
|
||||
<key keycode="27" name="AD04" oref="outline2" />
|
||||
<key keycode="28" name="AD05" oref="outline2" />
|
||||
<key keycode="29" name="AD06" oref="outline2" />
|
||||
<key keycode="30" name="AD07" oref="outline2" />
|
||||
<key keycode="31" name="AD08" oref="outline2" />
|
||||
<key keycode="32" name="AD09" oref="outline2" />
|
||||
<key keycode="33" name="AD10" oref="outline2" />
|
||||
<key keycode="34" name="AD11" oref="outline2" />
|
||||
<key name="AD01" oref="outline2" />
|
||||
<key name="AD02" oref="outline2" />
|
||||
<key name="AD03" oref="outline2" />
|
||||
<key name="AD04" oref="outline2" />
|
||||
<key name="AD05" oref="outline2" />
|
||||
<key name="AD06" oref="outline2" />
|
||||
<key name="AD07" oref="outline2" />
|
||||
<key name="AD08" oref="outline2" />
|
||||
<key name="AD09" oref="outline2" />
|
||||
<key name="AD10" oref="outline2" />
|
||||
<key name="AD11" oref="outline2" />
|
||||
</row>
|
||||
</section>
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="38" name="AC01" oref="outline2" />
|
||||
<key keycode="39" name="AC02" oref="outline2" />
|
||||
<key keycode="40" name="AC03" oref="outline2" />
|
||||
<key keycode="41" name="AC04" oref="outline2" />
|
||||
<key keycode="42" name="AC05" oref="outline2" />
|
||||
<key keycode="43" name="AC06" oref="outline2" />
|
||||
<key keycode="44" name="AC07" oref="outline2" />
|
||||
<key keycode="45" name="AC08" oref="outline2" />
|
||||
<key keycode="46" name="AC09" oref="outline2" />
|
||||
<key keycode="47" name="AC10" oref="outline2" />
|
||||
<key keycode="48" name="AC11" oref="outline2" />
|
||||
<key name="AC01" oref="outline2" />
|
||||
<key name="AC02" oref="outline2" />
|
||||
<key name="AC03" oref="outline2" />
|
||||
<key name="AC04" oref="outline2" />
|
||||
<key name="AC05" oref="outline2" />
|
||||
<key name="AC06" oref="outline2" />
|
||||
<key name="AC07" oref="outline2" />
|
||||
<key name="AC08" oref="outline2" />
|
||||
<key name="AC09" oref="outline2" />
|
||||
<key name="AC10" oref="outline2" />
|
||||
<key name="AC11" oref="outline2" />
|
||||
</row>
|
||||
</section>
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="50" name="LFSH" oref="altline" />
|
||||
<key keycode="52" name="AB01" oref="outline2" />
|
||||
<key keycode="53" name="AB02" oref="outline2" />
|
||||
<key keycode="54" name="AB03" oref="outline2" />
|
||||
<key keycode="55" name="AB04" oref="outline2" />
|
||||
<key keycode="56" name="AB05" oref="outline2" />
|
||||
<key keycode="57" name="AB06" oref="outline2" />
|
||||
<key keycode="58" name="AB07" oref="outline2" />
|
||||
<key keycode="22" name="BKSP" oref="altline" />
|
||||
<key name="LFSH" oref="altline" />
|
||||
<key name="AB01" oref="outline2" />
|
||||
<key name="AB02" oref="outline2" />
|
||||
<key name="AB03" oref="outline2" />
|
||||
<key name="AB04" oref="outline2" />
|
||||
<key name="AB05" oref="outline2" />
|
||||
<key name="AB06" oref="outline2" />
|
||||
<key name="AB07" oref="outline2" />
|
||||
<key name="BKSP" oref="altline" />
|
||||
</row>
|
||||
</section>
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="0" name="ABC123" oref="altline" />
|
||||
<key keycode="149" name="I149" oref="altline" />
|
||||
<key keycode="65" name="SPCE" oref="spaceline" />
|
||||
<key keycode="59" name="AB08" oref="outline2" />
|
||||
<key keycode="36" name="RTRN" oref="outline7" />
|
||||
<key name="I149" oref="altline" />
|
||||
<key name="SPCE" oref="spaceline" />
|
||||
<key name="AB08" oref="outline2" />
|
||||
<key name="RTRN" oref="outline7" />
|
||||
</row>
|
||||
</section>
|
||||
<outline id="outline2" corner-radius="1.000000">
|
||||
|
||||
@ -3,37 +3,37 @@
|
||||
<bounds x="0" y="10.000000" width="426.0000" height="296.5853"/>
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="24" name="AD01" oref="outline2" />
|
||||
<key keycode="25" name="AD02" oref="outline2" />
|
||||
<key keycode="26" name="AD03" oref="outline2" />
|
||||
<key keycode="27" name="AD04" oref="outline2" />
|
||||
<key keycode="28" name="AD05" oref="outline2" />
|
||||
<key name="AD01" oref="outline2" />
|
||||
<key name="AD02" oref="outline2" />
|
||||
<key name="AD03" oref="outline2" />
|
||||
<key name="AD04" oref="outline2" />
|
||||
<key name="AD05" oref="outline2" />
|
||||
</row>
|
||||
</section>
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="38" name="AC01" oref="outline2" />
|
||||
<key keycode="39" name="AC02" oref="outline2" />
|
||||
<key keycode="40" name="AC03" oref="outline2" />
|
||||
<key keycode="41" name="AC04" oref="outline2" />
|
||||
<key keycode="42" name="AC05" oref="outline2" />
|
||||
<key name="AC01" oref="outline2" />
|
||||
<key name="AC02" oref="outline2" />
|
||||
<key name="AC03" oref="outline2" />
|
||||
<key name="AC04" oref="outline2" />
|
||||
<key name="AC05" oref="outline2" />
|
||||
</row>
|
||||
</section>
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="52" name="AB01" oref="outline2" />
|
||||
<key keycode="53" name="AB02" oref="outline2" />
|
||||
<key keycode="54" name="AB03" oref="outline2" />
|
||||
<key keycode="55" name="AB04" oref="outline2" />
|
||||
<key keycode="56" name="AB05" oref="outline2" />
|
||||
<key name="AB01" oref="outline2" />
|
||||
<key name="AB02" oref="outline2" />
|
||||
<key name="AB03" oref="outline2" />
|
||||
<key name="AB04" oref="outline2" />
|
||||
<key name="AB05" oref="outline2" />
|
||||
</row>
|
||||
</section>
|
||||
<section angle="0">
|
||||
<row orientation="1">
|
||||
<key keycode="22" name="BKSP" oref="altline" />
|
||||
<key keycode="57" name="AB06" oref="outline2" />
|
||||
<key keycode="65" name="SPCE" oref="spaceline" />
|
||||
<key keycode="36" name="RTRN" oref="outline7" />
|
||||
<key name="BKSP" oref="altline" />
|
||||
<key name="AB06" oref="outline2" />
|
||||
<key name="SPCE" oref="spaceline" />
|
||||
<key name="RTRN" oref="outline7" />
|
||||
</row>
|
||||
</section>
|
||||
<outline id="outline2" corner-radius="1.000000">
|
||||
|
||||
@ -1,308 +0,0 @@
|
||||
xkb_keymap {
|
||||
|
||||
xkb_keycodes "squeekboard" {
|
||||
minimum = 8;
|
||||
maximum = 255;
|
||||
<ESC> = 9;
|
||||
<AE01> = 10;
|
||||
<AE02> = 11;
|
||||
<AE03> = 12;
|
||||
<AE04> = 13;
|
||||
<AE05> = 14;
|
||||
<AE06> = 15;
|
||||
<AE07> = 16;
|
||||
<AE08> = 17;
|
||||
<AE09> = 18;
|
||||
<AE10> = 19;
|
||||
<AE11> = 20;
|
||||
<AE12> = 21;
|
||||
<BKSP> = 22;
|
||||
<TAB> = 23;
|
||||
<AD01> = 24;
|
||||
<AD02> = 25;
|
||||
<AD03> = 26;
|
||||
<AD04> = 27;
|
||||
<AD05> = 28;
|
||||
<AD06> = 29;
|
||||
<AD07> = 30;
|
||||
<AD08> = 31;
|
||||
<AD09> = 32;
|
||||
<AD10> = 33;
|
||||
<AD11> = 34;
|
||||
<AD12> = 35;
|
||||
<RTRN> = 36;
|
||||
<LCTL> = 37;
|
||||
<AC01> = 38;
|
||||
<AC02> = 39;
|
||||
<AC03> = 40;
|
||||
<AC04> = 41;
|
||||
<AC05> = 42;
|
||||
<AC06> = 43;
|
||||
<AC07> = 44;
|
||||
<AC08> = 45;
|
||||
<AC09> = 46;
|
||||
<AC10> = 47;
|
||||
<AC11> = 48;
|
||||
<TLDE> = 49;
|
||||
<LFSH> = 50;
|
||||
<BKSL> = 51;
|
||||
<AB01> = 52;
|
||||
<AB02> = 53;
|
||||
<AB03> = 54;
|
||||
<AB04> = 55;
|
||||
<AB05> = 56;
|
||||
<AB06> = 57;
|
||||
<AB07> = 58;
|
||||
<AB08> = 59;
|
||||
<AB09> = 60;
|
||||
<AB10> = 61;
|
||||
<RTSH> = 62;
|
||||
<KPMU> = 63;
|
||||
<LALT> = 64;
|
||||
<SPCE> = 65;
|
||||
<CAPS> = 66;
|
||||
<FK01> = 67;
|
||||
<FK02> = 68;
|
||||
<FK03> = 69;
|
||||
<FK04> = 70;
|
||||
<FK05> = 71;
|
||||
<FK06> = 72;
|
||||
<FK07> = 73;
|
||||
<FK08> = 74;
|
||||
<FK09> = 75;
|
||||
<FK10> = 76;
|
||||
<NMLK> = 77;
|
||||
<SCLK> = 78;
|
||||
<KP7> = 79;
|
||||
<KP8> = 80;
|
||||
<KP9> = 81;
|
||||
<KPSU> = 82;
|
||||
<KP4> = 83;
|
||||
<KP5> = 84;
|
||||
<KP6> = 85;
|
||||
<KPAD> = 86;
|
||||
<KP1> = 87;
|
||||
<KP2> = 88;
|
||||
<KP3> = 89;
|
||||
<KP0> = 90;
|
||||
<KPDL> = 91;
|
||||
<LVL3> = 92;
|
||||
<LSGT> = 94;
|
||||
<FK11> = 95;
|
||||
<FK12> = 96;
|
||||
<AB11> = 97;
|
||||
<KATA> = 98;
|
||||
<HIRA> = 99;
|
||||
<HENK> = 100;
|
||||
<HKTG> = 101;
|
||||
<MUHE> = 102;
|
||||
<JPCM> = 103;
|
||||
<KPEN> = 104;
|
||||
<RCTL> = 105;
|
||||
<KPDV> = 106;
|
||||
<PRSC> = 107;
|
||||
<RALT> = 108;
|
||||
<LNFD> = 109;
|
||||
<HOME> = 110;
|
||||
<UP> = 111;
|
||||
<PGUP> = 112;
|
||||
<LEFT> = 113;
|
||||
<RGHT> = 114;
|
||||
<END> = 115;
|
||||
<DOWN> = 116;
|
||||
<PGDN> = 117;
|
||||
<INS> = 118;
|
||||
<DELE> = 119;
|
||||
<I120> = 120;
|
||||
<MUTE> = 121;
|
||||
<VOL-> = 122;
|
||||
<VOL+> = 123;
|
||||
<POWR> = 124;
|
||||
<KPEQ> = 125;
|
||||
<I126> = 126;
|
||||
<PAUS> = 127;
|
||||
<I128> = 128;
|
||||
<I129> = 129;
|
||||
<HNGL> = 130;
|
||||
<HJCV> = 131;
|
||||
<AE13> = 132;
|
||||
<LWIN> = 133;
|
||||
<RWIN> = 134;
|
||||
<COMP> = 135;
|
||||
<STOP> = 136;
|
||||
<AGAI> = 137;
|
||||
<PROP> = 138;
|
||||
<UNDO> = 139;
|
||||
<FRNT> = 140;
|
||||
<COPY> = 141;
|
||||
<OPEN> = 142;
|
||||
<PAST> = 143;
|
||||
<FIND> = 144;
|
||||
<CUT> = 145;
|
||||
<HELP> = 146;
|
||||
<I147> = 147;
|
||||
<I148> = 148;
|
||||
<I149> = 149;
|
||||
<I150> = 150;
|
||||
<I151> = 151;
|
||||
<I152> = 152;
|
||||
<I153> = 153;
|
||||
<I154> = 154;
|
||||
<I155> = 155;
|
||||
<I156> = 156;
|
||||
<I157> = 157;
|
||||
<I158> = 158;
|
||||
<I159> = 159;
|
||||
<I160> = 160;
|
||||
<I161> = 161;
|
||||
<I162> = 162;
|
||||
<I163> = 163;
|
||||
<I164> = 164;
|
||||
<I165> = 165;
|
||||
<I166> = 166;
|
||||
<I167> = 167;
|
||||
<I168> = 168;
|
||||
<I169> = 169;
|
||||
<I170> = 170;
|
||||
<I171> = 171;
|
||||
<I172> = 172;
|
||||
<I173> = 173;
|
||||
<I174> = 174;
|
||||
<I175> = 175;
|
||||
<I176> = 176;
|
||||
<I177> = 177;
|
||||
<I178> = 178;
|
||||
<I179> = 179;
|
||||
<I180> = 180;
|
||||
<I181> = 181;
|
||||
<I182> = 182;
|
||||
<I183> = 183;
|
||||
<I184> = 184;
|
||||
<I185> = 185;
|
||||
<I186> = 186;
|
||||
<I187> = 187;
|
||||
<I188> = 188;
|
||||
<I189> = 189;
|
||||
<I190> = 190;
|
||||
<FK13> = 191;
|
||||
<FK14> = 192;
|
||||
<FK15> = 193;
|
||||
<FK16> = 194;
|
||||
<FK17> = 195;
|
||||
<FK18> = 196;
|
||||
<FK19> = 197;
|
||||
<FK20> = 198;
|
||||
<FK21> = 199;
|
||||
<FK22> = 200;
|
||||
<FK23> = 201;
|
||||
<FK24> = 202;
|
||||
<MDSW> = 203;
|
||||
<ALT> = 204;
|
||||
<META> = 205;
|
||||
<SUPR> = 206;
|
||||
<HYPR> = 207;
|
||||
<I208> = 208;
|
||||
<I209> = 209;
|
||||
<I210> = 210;
|
||||
<I211> = 211;
|
||||
<I212> = 212;
|
||||
<I213> = 213;
|
||||
<I214> = 214;
|
||||
<I215> = 215;
|
||||
<I216> = 216;
|
||||
<I217> = 217;
|
||||
<I218> = 218;
|
||||
<I219> = 219;
|
||||
<I220> = 220;
|
||||
<I221> = 221;
|
||||
<I222> = 222;
|
||||
<I223> = 223;
|
||||
<I224> = 224;
|
||||
<I225> = 225;
|
||||
<I226> = 226;
|
||||
<I227> = 227;
|
||||
<I228> = 228;
|
||||
<I229> = 229;
|
||||
<I230> = 230;
|
||||
<I231> = 231;
|
||||
<I232> = 232;
|
||||
<I233> = 233;
|
||||
<I234> = 234;
|
||||
<I235> = 235;
|
||||
<I236> = 236;
|
||||
<I237> = 237;
|
||||
<I238> = 238;
|
||||
<I239> = 239;
|
||||
<I240> = 240;
|
||||
<I241> = 241;
|
||||
<I242> = 242;
|
||||
<I243> = 243;
|
||||
<I244> = 244;
|
||||
<I245> = 245;
|
||||
<I246> = 246;
|
||||
<I247> = 247;
|
||||
<I248> = 248;
|
||||
<I249> = 249;
|
||||
<I250> = 250;
|
||||
<I251> = 251;
|
||||
<I252> = 252;
|
||||
<I253> = 253;
|
||||
<I254> = 254;
|
||||
<I255> = 255;
|
||||
};
|
||||
|
||||
xkb_symbols "squeekboard" {
|
||||
|
||||
name[Group1] = "Letters";
|
||||
name[Group2] = "Numbers/Symbols";
|
||||
|
||||
key <AD01> { [ q, Q ], [ 1, asciitilde ] };
|
||||
key <AD02> { [ w, W ], [ 2, quoteleft ] };
|
||||
key <AD03> { [ e, E ], [ 3, bar ] };
|
||||
key <AD04> { [ r, R ], [ 4, U00B7 ] };
|
||||
key <AD05> { [ t, T ], [ 5, squareroot ] };
|
||||
key <AD06> { [ y, Y ], [ 6, Greek_pi ] };
|
||||
key <AD07> { [ u, U ], [ 7, division ] };
|
||||
key <AD08> { [ i, I ], [ 8, multiply ] };
|
||||
key <AD09> { [ o, O ], [ 9, paragraph ] };
|
||||
key <AD10> { [ p, P ], [ 0, U25B3 ] };
|
||||
key <AD11> { [ aring, Aring ], [ U00B1, U00A7 ] };
|
||||
key <AC01> { [ a, A ], [ at, copyright ] };
|
||||
key <AC02> { [ s, S ], [ numbersign, U00AE ] };
|
||||
key <AC03> { [ d, D ], [ dollar, U00A3 ] };
|
||||
key <AC04> { [ f, F ], [ percent, EuroSign ] };
|
||||
key <AC05> { [ g, G ], [ ampersand, U00A5 ] };
|
||||
key <AC06> { [ h, H ], [ minus, underscore ] };
|
||||
key <AC07> { [ j, J ], [ plus, equal ] };
|
||||
key <AC08> { [ k, K ], [ U00FC, asciicircum ] };
|
||||
key <AC09> { [ l, L ], [ U00F6, degree ] };
|
||||
key <AC10> { [ oslash, Oslash ], [ parenleft, braceleft ] };
|
||||
key <AC11> { [ ae, AE ], [ parenright, braceright ] };
|
||||
key <RTRN> { [ Return, Return ], [ Return, Return ] };
|
||||
key <LFSH> { [ Shift_L, Shift_L ], [ Shift_L, Shift_L ] };
|
||||
key <AB01> { [ z, Z ], [ comma, backslash ] };
|
||||
key <AB02> { [ x, X ], [ quotedbl, slash ] };
|
||||
key <AB03> { [ c, C ], [ quoteright, less ] };
|
||||
key <AB04> { [ v, V ], [ colon, greater ] };
|
||||
key <AB05> { [ b, B ], [ semicolon, equal ] };
|
||||
key <AB06> { [ n, N ], [ exclam, bracketleft ] };
|
||||
key <AB07> { [ m, M ], [ question, bracketright ] };
|
||||
key <AB08> { [ period, period ], [ period, period ] };
|
||||
key <I149> { [ preferences, preferences ], [ preferences, preferences ] };
|
||||
key <SPCE> { [ space, space ], [ space, space ] };
|
||||
key <BKSP> { [ BackSpace, BackSpace ], [ BackSpace, BackSpace ] };
|
||||
};
|
||||
|
||||
xkb_types "squeekboard" {
|
||||
|
||||
type "TWO_LEVEL" {
|
||||
modifiers = Shift;
|
||||
map[Shift] = Level2;
|
||||
level_name[Level1] = "Base";
|
||||
level_name[Level2] = "Shift";
|
||||
};
|
||||
};
|
||||
|
||||
xkb_compatibility "squeekboard" {
|
||||
};
|
||||
};
|
||||
@ -1,292 +0,0 @@
|
||||
xkb_keymap {
|
||||
|
||||
xkb_keycodes "squeekboard" {
|
||||
minimum = 8;
|
||||
maximum = 255;
|
||||
<ESC> = 9;
|
||||
<AE01> = 10;
|
||||
<AE02> = 11;
|
||||
<AE03> = 12;
|
||||
<AE04> = 13;
|
||||
<AE05> = 14;
|
||||
<AE06> = 15;
|
||||
<AE07> = 16;
|
||||
<AE08> = 17;
|
||||
<AE09> = 18;
|
||||
<AE10> = 19;
|
||||
<AE11> = 20;
|
||||
<AE12> = 21;
|
||||
<BKSP> = 22;
|
||||
<TAB> = 23;
|
||||
<AD01> = 24;
|
||||
<AD02> = 25;
|
||||
<AD03> = 26;
|
||||
<AD04> = 27;
|
||||
<AD05> = 28;
|
||||
<AD06> = 29;
|
||||
<AD07> = 30;
|
||||
<AD08> = 31;
|
||||
<AD09> = 32;
|
||||
<AD10> = 33;
|
||||
<AD11> = 34;
|
||||
<AD12> = 35;
|
||||
<RTRN> = 36;
|
||||
<LCTL> = 37;
|
||||
<AC01> = 38;
|
||||
<AC02> = 39;
|
||||
<AC03> = 40;
|
||||
<AC04> = 41;
|
||||
<AC05> = 42;
|
||||
<AC06> = 43;
|
||||
<AC07> = 44;
|
||||
<AC08> = 45;
|
||||
<AC09> = 46;
|
||||
<AC10> = 47;
|
||||
<AC11> = 48;
|
||||
<TLDE> = 49;
|
||||
<LFSH> = 50;
|
||||
<BKSL> = 51;
|
||||
<AB01> = 52;
|
||||
<AB02> = 53;
|
||||
<AB03> = 54;
|
||||
<AB04> = 55;
|
||||
<AB05> = 56;
|
||||
<AB06> = 57;
|
||||
<AB07> = 58;
|
||||
<AB08> = 59;
|
||||
<AB09> = 60;
|
||||
<AB10> = 61;
|
||||
<RTSH> = 62;
|
||||
<KPMU> = 63;
|
||||
<LALT> = 64;
|
||||
<SPCE> = 65;
|
||||
<CAPS> = 66;
|
||||
<FK01> = 67;
|
||||
<FK02> = 68;
|
||||
<FK03> = 69;
|
||||
<FK04> = 70;
|
||||
<FK05> = 71;
|
||||
<FK06> = 72;
|
||||
<FK07> = 73;
|
||||
<FK08> = 74;
|
||||
<FK09> = 75;
|
||||
<FK10> = 76;
|
||||
<NMLK> = 77;
|
||||
<SCLK> = 78;
|
||||
<KP7> = 79;
|
||||
<KP8> = 80;
|
||||
<KP9> = 81;
|
||||
<KPSU> = 82;
|
||||
<KP4> = 83;
|
||||
<KP5> = 84;
|
||||
<KP6> = 85;
|
||||
<KPAD> = 86;
|
||||
<KP1> = 87;
|
||||
<KP2> = 88;
|
||||
<KP3> = 89;
|
||||
<KP0> = 90;
|
||||
<KPDL> = 91;
|
||||
<LVL3> = 92;
|
||||
<LSGT> = 94;
|
||||
<FK11> = 95;
|
||||
<FK12> = 96;
|
||||
<AB11> = 97;
|
||||
<KATA> = 98;
|
||||
<HIRA> = 99;
|
||||
<HENK> = 100;
|
||||
<HKTG> = 101;
|
||||
<MUHE> = 102;
|
||||
<JPCM> = 103;
|
||||
<KPEN> = 104;
|
||||
<RCTL> = 105;
|
||||
<KPDV> = 106;
|
||||
<PRSC> = 107;
|
||||
<RALT> = 108;
|
||||
<LNFD> = 109;
|
||||
<HOME> = 110;
|
||||
<UP> = 111;
|
||||
<PGUP> = 112;
|
||||
<LEFT> = 113;
|
||||
<RGHT> = 114;
|
||||
<END> = 115;
|
||||
<DOWN> = 116;
|
||||
<PGDN> = 117;
|
||||
<INS> = 118;
|
||||
<DELE> = 119;
|
||||
<I120> = 120;
|
||||
<MUTE> = 121;
|
||||
<VOL-> = 122;
|
||||
<VOL+> = 123;
|
||||
<POWR> = 124;
|
||||
<KPEQ> = 125;
|
||||
<I126> = 126;
|
||||
<PAUS> = 127;
|
||||
<I128> = 128;
|
||||
<I129> = 129;
|
||||
<HNGL> = 130;
|
||||
<HJCV> = 131;
|
||||
<AE13> = 132;
|
||||
<LWIN> = 133;
|
||||
<RWIN> = 134;
|
||||
<COMP> = 135;
|
||||
<STOP> = 136;
|
||||
<AGAI> = 137;
|
||||
<PROP> = 138;
|
||||
<UNDO> = 139;
|
||||
<FRNT> = 140;
|
||||
<COPY> = 141;
|
||||
<OPEN> = 142;
|
||||
<PAST> = 143;
|
||||
<FIND> = 144;
|
||||
<CUT> = 145;
|
||||
<HELP> = 146;
|
||||
<I147> = 147;
|
||||
<I148> = 148;
|
||||
<I149> = 149;
|
||||
<I150> = 150;
|
||||
<I151> = 151;
|
||||
<I152> = 152;
|
||||
<I153> = 153;
|
||||
<I154> = 154;
|
||||
<I155> = 155;
|
||||
<I156> = 156;
|
||||
<I157> = 157;
|
||||
<I158> = 158;
|
||||
<I159> = 159;
|
||||
<I160> = 160;
|
||||
<I161> = 161;
|
||||
<I162> = 162;
|
||||
<I163> = 163;
|
||||
<I164> = 164;
|
||||
<I165> = 165;
|
||||
<I166> = 166;
|
||||
<I167> = 167;
|
||||
<I168> = 168;
|
||||
<I169> = 169;
|
||||
<I170> = 170;
|
||||
<I171> = 171;
|
||||
<I172> = 172;
|
||||
<I173> = 173;
|
||||
<I174> = 174;
|
||||
<I175> = 175;
|
||||
<I176> = 176;
|
||||
<I177> = 177;
|
||||
<I178> = 178;
|
||||
<I179> = 179;
|
||||
<I180> = 180;
|
||||
<I181> = 181;
|
||||
<I182> = 182;
|
||||
<I183> = 183;
|
||||
<I184> = 184;
|
||||
<I185> = 185;
|
||||
<I186> = 186;
|
||||
<I187> = 187;
|
||||
<I188> = 188;
|
||||
<I189> = 189;
|
||||
<I190> = 190;
|
||||
<FK13> = 191;
|
||||
<FK14> = 192;
|
||||
<FK15> = 193;
|
||||
<FK16> = 194;
|
||||
<FK17> = 195;
|
||||
<FK18> = 196;
|
||||
<FK19> = 197;
|
||||
<FK20> = 198;
|
||||
<FK21> = 199;
|
||||
<FK22> = 200;
|
||||
<FK23> = 201;
|
||||
<FK24> = 202;
|
||||
<MDSW> = 203;
|
||||
<ALT> = 204;
|
||||
<META> = 205;
|
||||
<SUPR> = 206;
|
||||
<HYPR> = 207;
|
||||
<I208> = 208;
|
||||
<I209> = 209;
|
||||
<I210> = 210;
|
||||
<I211> = 211;
|
||||
<I212> = 212;
|
||||
<I213> = 213;
|
||||
<I214> = 214;
|
||||
<I215> = 215;
|
||||
<I216> = 216;
|
||||
<I217> = 217;
|
||||
<I218> = 218;
|
||||
<I219> = 219;
|
||||
<I220> = 220;
|
||||
<I221> = 221;
|
||||
<I222> = 222;
|
||||
<I223> = 223;
|
||||
<I224> = 224;
|
||||
<I225> = 225;
|
||||
<I226> = 226;
|
||||
<I227> = 227;
|
||||
<I228> = 228;
|
||||
<I229> = 229;
|
||||
<I230> = 230;
|
||||
<I231> = 231;
|
||||
<I232> = 232;
|
||||
<I233> = 233;
|
||||
<I234> = 234;
|
||||
<I235> = 235;
|
||||
<I236> = 236;
|
||||
<I237> = 237;
|
||||
<I238> = 238;
|
||||
<I239> = 239;
|
||||
<I240> = 240;
|
||||
<I241> = 241;
|
||||
<I242> = 242;
|
||||
<I243> = 243;
|
||||
<I244> = 244;
|
||||
<I245> = 245;
|
||||
<I246> = 246;
|
||||
<I247> = 247;
|
||||
<I248> = 248;
|
||||
<I249> = 249;
|
||||
<I250> = 250;
|
||||
<I251> = 251;
|
||||
<I252> = 252;
|
||||
<I253> = 253;
|
||||
<I254> = 254;
|
||||
<I255> = 255;
|
||||
};
|
||||
|
||||
xkb_symbols "squeekboard" {
|
||||
|
||||
name[Group1] = "Letters";
|
||||
name[Group2] = "Numbers/Symbols";
|
||||
|
||||
key <AD01> { [ 1, 1 ], [ 1, 1 ] };
|
||||
key <AD02> { [ 2, 2 ], [ 2, 2 ] };
|
||||
key <AD03> { [ 3, 3 ], [ 3, 3 ] };
|
||||
key <AD04> { [ parenleft, parenleft ], [ parenleft, parenleft ] };
|
||||
key <AD05> { [ parenright, parenright ], [ parenright, parenright ] };
|
||||
key <AC01> { [ 4, 4 ], [ 4, 4 ] };
|
||||
key <AC02> { [ 5, 5 ], [ 5, 5 ] };
|
||||
key <AC03> { [ 6, 6 ], [ 6, 6 ] };
|
||||
key <AC04> { [ numbersign, numbersign ], [ numbersign, numbersign ] };
|
||||
key <AC05> { [ asterisk, asterisk ], [ asterisk, asterisk ] };
|
||||
key <AB01> { [ 7, 7 ], [ 7, 7 ] };
|
||||
key <AB02> { [ 8, 8 ], [ 8, 8 ] };
|
||||
key <AB03> { [ 9, 9 ], [ 9, 9 ] };
|
||||
key <AB04> { [ plus, plus ], [ plus, plus ] };
|
||||
key <AB05> { [ minus, minus ], [ minus, minus ] };
|
||||
key <AB06> { [ 0, 0 ], [ 0, 0 ] };
|
||||
key <RTRN> { [ Return, Return ], [ Return, Return ] };
|
||||
key <SPCE> { [ space, space ], [ space, space ] };
|
||||
key <BKSP> { [ BackSpace, BackSpace ], [ BackSpace, BackSpace ] };
|
||||
};
|
||||
|
||||
xkb_types "squeekboard" {
|
||||
|
||||
type "TWO_LEVEL" {
|
||||
modifiers = Shift;
|
||||
map[Shift] = Level2;
|
||||
level_name[Level1] = "Base";
|
||||
level_name[Level2] = "Shift";
|
||||
};
|
||||
};
|
||||
|
||||
xkb_compatibility "squeekboard" {
|
||||
};
|
||||
};
|
||||
@ -1,306 +0,0 @@
|
||||
xkb_keymap {
|
||||
|
||||
xkb_keycodes "squeekboard" {
|
||||
minimum = 8;
|
||||
maximum = 255;
|
||||
<ESC> = 9;
|
||||
<AE01> = 10;
|
||||
<AE02> = 11;
|
||||
<AE03> = 12;
|
||||
<AE04> = 13;
|
||||
<AE05> = 14;
|
||||
<AE06> = 15;
|
||||
<AE07> = 16;
|
||||
<AE08> = 17;
|
||||
<AE09> = 18;
|
||||
<AE10> = 19;
|
||||
<AE11> = 20;
|
||||
<AE12> = 21;
|
||||
<BKSP> = 22;
|
||||
<TAB> = 23;
|
||||
<AD01> = 24;
|
||||
<AD02> = 25;
|
||||
<AD03> = 26;
|
||||
<AD04> = 27;
|
||||
<AD05> = 28;
|
||||
<AD06> = 29;
|
||||
<AD07> = 30;
|
||||
<AD08> = 31;
|
||||
<AD09> = 32;
|
||||
<AD10> = 33;
|
||||
<AD11> = 34;
|
||||
<AD12> = 35;
|
||||
<RTRN> = 36;
|
||||
<LCTL> = 37;
|
||||
<AC01> = 38;
|
||||
<AC02> = 39;
|
||||
<AC03> = 40;
|
||||
<AC04> = 41;
|
||||
<AC05> = 42;
|
||||
<AC06> = 43;
|
||||
<AC07> = 44;
|
||||
<AC08> = 45;
|
||||
<AC09> = 46;
|
||||
<AC10> = 47;
|
||||
<AC11> = 48;
|
||||
<TLDE> = 49;
|
||||
<LFSH> = 50;
|
||||
<BKSL> = 51;
|
||||
<AB01> = 52;
|
||||
<AB02> = 53;
|
||||
<AB03> = 54;
|
||||
<AB04> = 55;
|
||||
<AB05> = 56;
|
||||
<AB06> = 57;
|
||||
<AB07> = 58;
|
||||
<AB08> = 59;
|
||||
<AB09> = 60;
|
||||
<AB10> = 61;
|
||||
<RTSH> = 62;
|
||||
<KPMU> = 63;
|
||||
<LALT> = 64;
|
||||
<SPCE> = 65;
|
||||
<CAPS> = 66;
|
||||
<FK01> = 67;
|
||||
<FK02> = 68;
|
||||
<FK03> = 69;
|
||||
<FK04> = 70;
|
||||
<FK05> = 71;
|
||||
<FK06> = 72;
|
||||
<FK07> = 73;
|
||||
<FK08> = 74;
|
||||
<FK09> = 75;
|
||||
<FK10> = 76;
|
||||
<NMLK> = 77;
|
||||
<SCLK> = 78;
|
||||
<KP7> = 79;
|
||||
<KP8> = 80;
|
||||
<KP9> = 81;
|
||||
<KPSU> = 82;
|
||||
<KP4> = 83;
|
||||
<KP5> = 84;
|
||||
<KP6> = 85;
|
||||
<KPAD> = 86;
|
||||
<KP1> = 87;
|
||||
<KP2> = 88;
|
||||
<KP3> = 89;
|
||||
<KP0> = 90;
|
||||
<KPDL> = 91;
|
||||
<LVL3> = 92;
|
||||
<LSGT> = 94;
|
||||
<FK11> = 95;
|
||||
<FK12> = 96;
|
||||
<AB11> = 97;
|
||||
<KATA> = 98;
|
||||
<HIRA> = 99;
|
||||
<HENK> = 100;
|
||||
<HKTG> = 101;
|
||||
<MUHE> = 102;
|
||||
<JPCM> = 103;
|
||||
<KPEN> = 104;
|
||||
<RCTL> = 105;
|
||||
<KPDV> = 106;
|
||||
<PRSC> = 107;
|
||||
<RALT> = 108;
|
||||
<LNFD> = 109;
|
||||
<HOME> = 110;
|
||||
<UP> = 111;
|
||||
<PGUP> = 112;
|
||||
<LEFT> = 113;
|
||||
<RGHT> = 114;
|
||||
<END> = 115;
|
||||
<DOWN> = 116;
|
||||
<PGDN> = 117;
|
||||
<INS> = 118;
|
||||
<DELE> = 119;
|
||||
<I120> = 120;
|
||||
<MUTE> = 121;
|
||||
<VOL-> = 122;
|
||||
<VOL+> = 123;
|
||||
<POWR> = 124;
|
||||
<KPEQ> = 125;
|
||||
<I126> = 126;
|
||||
<PAUS> = 127;
|
||||
<I128> = 128;
|
||||
<I129> = 129;
|
||||
<HNGL> = 130;
|
||||
<HJCV> = 131;
|
||||
<AE13> = 132;
|
||||
<LWIN> = 133;
|
||||
<RWIN> = 134;
|
||||
<COMP> = 135;
|
||||
<STOP> = 136;
|
||||
<AGAI> = 137;
|
||||
<PROP> = 138;
|
||||
<UNDO> = 139;
|
||||
<FRNT> = 140;
|
||||
<COPY> = 141;
|
||||
<OPEN> = 142;
|
||||
<PAST> = 143;
|
||||
<FIND> = 144;
|
||||
<CUT> = 145;
|
||||
<HELP> = 146;
|
||||
<I147> = 147;
|
||||
<I148> = 148;
|
||||
<I149> = 149;
|
||||
<I150> = 150;
|
||||
<I151> = 151;
|
||||
<I152> = 152;
|
||||
<I153> = 153;
|
||||
<I154> = 154;
|
||||
<I155> = 155;
|
||||
<I156> = 156;
|
||||
<I157> = 157;
|
||||
<I158> = 158;
|
||||
<I159> = 159;
|
||||
<I160> = 160;
|
||||
<I161> = 161;
|
||||
<I162> = 162;
|
||||
<I163> = 163;
|
||||
<I164> = 164;
|
||||
<I165> = 165;
|
||||
<I166> = 166;
|
||||
<I167> = 167;
|
||||
<I168> = 168;
|
||||
<I169> = 169;
|
||||
<I170> = 170;
|
||||
<I171> = 171;
|
||||
<I172> = 172;
|
||||
<I173> = 173;
|
||||
<I174> = 174;
|
||||
<I175> = 175;
|
||||
<I176> = 176;
|
||||
<I177> = 177;
|
||||
<I178> = 178;
|
||||
<I179> = 179;
|
||||
<I180> = 180;
|
||||
<I181> = 181;
|
||||
<I182> = 182;
|
||||
<I183> = 183;
|
||||
<I184> = 184;
|
||||
<I185> = 185;
|
||||
<I186> = 186;
|
||||
<I187> = 187;
|
||||
<I188> = 188;
|
||||
<I189> = 189;
|
||||
<I190> = 190;
|
||||
<FK13> = 191;
|
||||
<FK14> = 192;
|
||||
<FK15> = 193;
|
||||
<FK16> = 194;
|
||||
<FK17> = 195;
|
||||
<FK18> = 196;
|
||||
<FK19> = 197;
|
||||
<FK20> = 198;
|
||||
<FK21> = 199;
|
||||
<FK22> = 200;
|
||||
<FK23> = 201;
|
||||
<FK24> = 202;
|
||||
<MDSW> = 203;
|
||||
<ALT> = 204;
|
||||
<META> = 205;
|
||||
<SUPR> = 206;
|
||||
<HYPR> = 207;
|
||||
<I208> = 208;
|
||||
<I209> = 209;
|
||||
<I210> = 210;
|
||||
<I211> = 211;
|
||||
<I212> = 212;
|
||||
<I213> = 213;
|
||||
<I214> = 214;
|
||||
<I215> = 215;
|
||||
<I216> = 216;
|
||||
<I217> = 217;
|
||||
<I218> = 218;
|
||||
<I219> = 219;
|
||||
<I220> = 220;
|
||||
<I221> = 221;
|
||||
<I222> = 222;
|
||||
<I223> = 223;
|
||||
<I224> = 224;
|
||||
<I225> = 225;
|
||||
<I226> = 226;
|
||||
<I227> = 227;
|
||||
<I228> = 228;
|
||||
<I229> = 229;
|
||||
<I230> = 230;
|
||||
<I231> = 231;
|
||||
<I232> = 232;
|
||||
<I233> = 233;
|
||||
<I234> = 234;
|
||||
<I235> = 235;
|
||||
<I236> = 236;
|
||||
<I237> = 237;
|
||||
<I238> = 238;
|
||||
<I239> = 239;
|
||||
<I240> = 240;
|
||||
<I241> = 241;
|
||||
<I242> = 242;
|
||||
<I243> = 243;
|
||||
<I244> = 244;
|
||||
<I245> = 245;
|
||||
<I246> = 246;
|
||||
<I247> = 247;
|
||||
<I248> = 248;
|
||||
<I249> = 249;
|
||||
<I250> = 250;
|
||||
<I251> = 251;
|
||||
<I252> = 252;
|
||||
<I253> = 253;
|
||||
<I254> = 254;
|
||||
<I255> = 255;
|
||||
};
|
||||
|
||||
xkb_symbols "squeekboard" {
|
||||
|
||||
name[Group1] = "Letters";
|
||||
name[Group2] = "Numbers/Symbols";
|
||||
|
||||
key <AD01> { [ q, Q ], [ 1, asciitilde ] };
|
||||
key <AD02> { [ w, W ], [ 2, quoteleft ] };
|
||||
key <AD03> { [ e, E ], [ 3, bar ] };
|
||||
key <AD04> { [ r, R ], [ 4, U00B7 ] };
|
||||
key <AD05> { [ t, T ], [ 5, squareroot ] };
|
||||
key <AD06> { [ y, Y ], [ 6, Greek_pi ] };
|
||||
key <AD07> { [ u, U ], [ 7, division ] };
|
||||
key <AD08> { [ i, I ], [ 8, multiply ] };
|
||||
key <AD09> { [ o, O ], [ 9, paragraph ] };
|
||||
key <AD10> { [ p, P ], [ 0, U25B3 ] };
|
||||
key <AC01> { [ a, A ], [ at, copyright ] };
|
||||
key <AC02> { [ s, S ], [ numbersign, U00AE ] };
|
||||
key <AC03> { [ d, D ], [ dollar, U00A3 ] };
|
||||
key <AC04> { [ f, F ], [ percent, EuroSign ] };
|
||||
key <AC05> { [ g, G ], [ ampersand, U00A5 ] };
|
||||
key <AC06> { [ h, H ], [ minus, asciicircum ] };
|
||||
key <AC07> { [ j, J ], [ underscore, degree ] };
|
||||
key <AC08> { [ k, K ], [ plus, equal ] };
|
||||
key <AC09> { [ l, L ], [ parenleft, braceleft ] };
|
||||
key <AC10> { [ ], [ parenright, braceright ] };
|
||||
key <RTRN> { [ Return, Return ], [ Return, Return ] };
|
||||
key <LFSH> { [ Shift_L, Shift_L ], [ Shift_L, Shift_L ] };
|
||||
key <AB01> { [ z, Z ], [ comma, backslash ] };
|
||||
key <AB02> { [ x, X ], [ quotedbl, slash ] };
|
||||
key <AB03> { [ c, C ], [ quoteright, less ] };
|
||||
key <AB04> { [ v, V ], [ colon, greater ] };
|
||||
key <AB05> { [ b, B ], [ semicolon, equal ] };
|
||||
key <AB06> { [ n, N ], [ exclam, bracketleft ] };
|
||||
key <AB07> { [ m, M ], [ question, bracketright ] };
|
||||
key <AB08> { [ period, period ], [ period, period ] };
|
||||
key <I149> { [ preferences, preferences ], [ preferences, preferences ] };
|
||||
key <SPCE> { [ space, space ], [ space, space ] };
|
||||
key <BKSP> { [ BackSpace, BackSpace ], [ BackSpace, BackSpace ] };
|
||||
};
|
||||
|
||||
xkb_types "squeekboard" {
|
||||
|
||||
type "TWO_LEVEL" {
|
||||
modifiers = Shift;
|
||||
map[Shift] = Level2;
|
||||
level_name[Level1] = "Base";
|
||||
level_name[Level2] = "Shift";
|
||||
};
|
||||
};
|
||||
|
||||
xkb_compatibility "squeekboard" {
|
||||
};
|
||||
};
|
||||
@ -63,8 +63,10 @@
|
||||
<key name="AD11">
|
||||
<symbol keyval="229" label="å">aring</symbol>
|
||||
<symbol keyval="197" label="Å">Aring</symbol>
|
||||
<symbol label="±">U00B1</symbol>
|
||||
<symbol label="§">U00A7</symbol>
|
||||
<symbol label=""></symbol>
|
||||
<symbol label=""></symbol>
|
||||
<!-- Empty labels cause keys to be hidden when the level they are defined
|
||||
for is shown. -->
|
||||
</key>
|
||||
<key name="AC01">
|
||||
<symbol label="a">a</symbol>
|
||||
@ -100,37 +102,37 @@
|
||||
<symbol label="h">h</symbol>
|
||||
<symbol label="H">H</symbol>
|
||||
<symbol label="-">minus</symbol>
|
||||
<symbol label="_">underscore</symbol>
|
||||
<symbol label="^">asciicircum</symbol>
|
||||
</key>
|
||||
<key name="AC07">
|
||||
<symbol label="j">j</symbol>
|
||||
<symbol label="J">J</symbol>
|
||||
<symbol label="+">plus</symbol>
|
||||
<symbol label="=">equal</symbol>
|
||||
<symbol label="_">underscore</symbol>
|
||||
<symbol label="°">degree</symbol>
|
||||
</key>
|
||||
<key name="AC08">
|
||||
<symbol label="k">k</symbol>
|
||||
<symbol label="K">K</symbol>
|
||||
<symbol label="ü">U00FC</symbol>
|
||||
<symbol label="^">asciicircum</symbol>
|
||||
<symbol label="+">plus</symbol>
|
||||
<symbol label="=">equal</symbol>
|
||||
</key>
|
||||
<key name="AC09">
|
||||
<symbol label="l">l</symbol>
|
||||
<symbol label="L">L</symbol>
|
||||
<symbol label="ö">U00F6</symbol>
|
||||
<symbol label="°">degree</symbol>
|
||||
<symbol label="(">parenleft</symbol>
|
||||
<symbol label="{">braceleft</symbol>
|
||||
</key>
|
||||
<key name="AC10">
|
||||
<symbol keyval="248" label="ø">oslash</symbol>
|
||||
<symbol keyval="216" label="Ø">Oslash</symbol>
|
||||
<symbol label="(">parenleft</symbol>
|
||||
<symbol label="{">braceleft</symbol>
|
||||
<symbol label=")">parenright</symbol>
|
||||
<symbol label="}">braceright</symbol>
|
||||
</key>
|
||||
<key name="AC11">
|
||||
<symbol keyval="230" label="æ">ae</symbol>
|
||||
<symbol keyval="198" label="Æ">AE</symbol>
|
||||
<symbol label=")">parenright</symbol>
|
||||
<symbol label="}">braceright</symbol>
|
||||
<symbol label=""></symbol>
|
||||
<symbol label=""></symbol>
|
||||
</key>
|
||||
<key name="RTRN">
|
||||
<symbol keyval="65293" icon="key-enter">Return</symbol>
|
||||
|
||||
@ -115,6 +115,8 @@
|
||||
<symbol label="{">braceleft</symbol>
|
||||
</key>
|
||||
<key name="AC10">
|
||||
<!-- Empty labels cause keys to be hidden when the level they are defined
|
||||
for is shown. -->
|
||||
<symbol label=""></symbol>
|
||||
<symbol label=""></symbol>
|
||||
<symbol label=")">parenright</symbol>
|
||||
|
||||
@ -6,9 +6,6 @@
|
||||
<file compressed="true" preprocess="xml-stripblanks">keyboards/geometry/extended.xml</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">keyboards/geometry/numbers-keypad.xml</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">keyboards/keyboards.xml</file>
|
||||
<file compressed="true">keyboards/keymaps/nb.xkb</file>
|
||||
<file compressed="true">keyboards/keymaps/us.xkb</file>
|
||||
<file compressed="true">keyboards/keymaps/numbers.xkb</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">keyboards/symbols/ar.xml</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">keyboards/symbols/as-inscript.xml</file>
|
||||
<file compressed="true" preprocess="xml-stripblanks">keyboards/symbols/be.xml</file>
|
||||
|
||||
@ -28,6 +28,7 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include <glib/gprintf.h>
|
||||
|
||||
#include "eek-keyboard.h"
|
||||
#include "eek-marshalers.h"
|
||||
@ -36,6 +37,7 @@
|
||||
#include "eek-symbol.h"
|
||||
#include "eek-enumtypes.h"
|
||||
#include "eekboard/key-emitter.h"
|
||||
#include "keymap.h"
|
||||
|
||||
enum {
|
||||
PROP_0,
|
||||
@ -72,6 +74,8 @@ struct _EekKeyboardPrivate
|
||||
GList *pressed_keys;
|
||||
GList *locked_keys;
|
||||
GArray *outline_array;
|
||||
|
||||
/* Map key names to key objects: */
|
||||
GHashTable *names;
|
||||
|
||||
/* modifiers dynamically assigned at run time */
|
||||
@ -796,3 +800,93 @@ eek_keyboard_get_locked_keys (EekKeyboard *keyboard)
|
||||
g_return_val_if_fail (EEK_IS_KEYBOARD(keyboard), NULL);
|
||||
return g_list_copy (keyboard->priv->locked_keys);
|
||||
}
|
||||
|
||||
/**
|
||||
* eek_keyboard_get_keymap:
|
||||
* @keyboard: an #EekKeyboard
|
||||
*
|
||||
* Get the keymap for the keyboard.
|
||||
* Returns: a string containing the XKB keymap.
|
||||
*/
|
||||
gchar *
|
||||
eek_keyboard_get_keymap(EekKeyboard *keyboard)
|
||||
{
|
||||
/* Start the keycodes and symbols sections with their respective headers. */
|
||||
gchar *keycodes = g_strdup(keymap_keycodes_header);
|
||||
gchar *symbols = g_strdup(keymap_symbols_header);
|
||||
|
||||
/* Iterate over the keys in the name-to-key hash table. */
|
||||
GHashTableIter iter;
|
||||
gpointer key_name, key_ptr;
|
||||
g_hash_table_iter_init(&iter, keyboard->priv->names);
|
||||
|
||||
while (g_hash_table_iter_next(&iter, &key_name, &key_ptr)) {
|
||||
|
||||
gchar *current, *line;
|
||||
EekKey *key = EEK_KEY(key_ptr);
|
||||
int keycode = eek_key_get_keycode(key);
|
||||
|
||||
/* Don't include invalid keycodes in the keymap. */
|
||||
if (keycode == EEK_INVALID_KEYCODE)
|
||||
continue;
|
||||
|
||||
/* Append a key name-to-keycode definition to the keycodes section. */
|
||||
current = keycodes;
|
||||
line = g_strdup_printf(" <%s> = %i;\n", (char *)key_name, keycode);
|
||||
|
||||
keycodes = g_strconcat(current, line, NULL);
|
||||
g_free(line);
|
||||
g_free(current);
|
||||
|
||||
/* Find the symbols associated with the key. */
|
||||
EekSymbolMatrix *matrix = eek_key_get_symbol_matrix(key);
|
||||
EekSymbol *syms[4];
|
||||
int i, j;
|
||||
|
||||
/* Get the symbols for all the levels defined for the key, then
|
||||
pad it out with the first symbol for all levels up to the fourth. */
|
||||
for (i = 0; i < matrix->num_levels; ++i)
|
||||
syms[i] = eek_symbol_matrix_get_symbol(matrix, 0, i);
|
||||
|
||||
while (i < 4) {
|
||||
syms[i] = eek_symbol_matrix_get_symbol(matrix, 0, 0);
|
||||
i++;
|
||||
}
|
||||
|
||||
/* The four levels are split into two groups in the keymap.
|
||||
Generate strings for each of these groups, where an empty group is
|
||||
treated specially. */
|
||||
|
||||
gchar *groups[2];
|
||||
for (i = 0, j = 0; i < 2; ++i, j += 2) {
|
||||
if (syms[j] && syms[j + 1])
|
||||
groups[i] = g_strjoin(", ", eek_symbol_get_name(syms[j]),
|
||||
eek_symbol_get_name(syms[j + 1]),
|
||||
NULL);
|
||||
else
|
||||
groups[i] = "";
|
||||
}
|
||||
|
||||
/* Append a key definition to the symbols section. */
|
||||
current = symbols;
|
||||
line = g_strdup_printf(" key <%s> { [ %s ], [ %s ] };\n",
|
||||
(char *)key_name, groups[0], groups[1]);
|
||||
|
||||
g_free(groups[0]);
|
||||
g_free(groups[1]);
|
||||
|
||||
symbols = g_strconcat(current, line, NULL);
|
||||
g_free(line);
|
||||
g_free(current);
|
||||
}
|
||||
|
||||
/* Assemble the keymap file from the header, sections and footer. */
|
||||
gchar *keymap = g_strconcat(keymap_header,
|
||||
keycodes, " };\n\n",
|
||||
symbols, " };\n\n",
|
||||
keymap_footer, NULL);
|
||||
|
||||
g_free(keycodes);
|
||||
g_free(symbols);
|
||||
return keymap;
|
||||
}
|
||||
|
||||
@ -195,5 +195,8 @@ void eek_modifier_key_free
|
||||
void eek_keyboard_press_key(EekKeyboard *keyboard, EekKey *key, guint32 timestamp);
|
||||
void eek_keyboard_release_key(EekKeyboard *keyboard, EekKey *key, guint32 timestamp);
|
||||
|
||||
gchar * eek_keyboard_get_keymap
|
||||
(EekKeyboard *keyboard);
|
||||
|
||||
G_END_DECLS
|
||||
#endif /* EEK_KEYBOARD_H */
|
||||
|
||||
@ -535,7 +535,8 @@ keycounter (EekElement *element, gpointer user_data)
|
||||
{
|
||||
EekKey *key = EEK_KEY(element);
|
||||
|
||||
/* Skip keys without labels for the current level. */
|
||||
/* Skip keys without labels for the current level. This causes those
|
||||
keys to be hidden in the visible layout. */
|
||||
if (!eek_key_has_label(key))
|
||||
return;
|
||||
|
||||
|
||||
@ -247,6 +247,7 @@ struct _GeometryParseData {
|
||||
gchar *name;
|
||||
EekOutline outline;
|
||||
gchar *oref;
|
||||
gint keycode;
|
||||
|
||||
GHashTable *key_oref_hash;
|
||||
GHashTable *oref_outline_hash;
|
||||
@ -269,6 +270,7 @@ geometry_parse_data_new (EekKeyboard *keyboard)
|
||||
g_str_equal,
|
||||
g_free,
|
||||
(GDestroyNotify)eek_outline_free);
|
||||
data->keycode = 8;
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -396,17 +398,6 @@ geometry_start_element_callback (GMarkupParseContext *pcontext,
|
||||
if (g_strcmp0 (element_name, "key") == 0) {
|
||||
guint keycode;
|
||||
|
||||
attribute = get_attribute (attribute_names, attribute_values,
|
||||
"keycode");
|
||||
if (attribute == NULL) {
|
||||
g_set_error (error,
|
||||
G_MARKUP_ERROR,
|
||||
G_MARKUP_ERROR_MISSING_ATTRIBUTE,
|
||||
"no \"keycode\" attribute for \"key\"");
|
||||
return;
|
||||
}
|
||||
keycode = strtol (attribute, NULL, 10);
|
||||
|
||||
attribute = get_attribute (attribute_names, attribute_values,
|
||||
"name");
|
||||
if (attribute == NULL) {
|
||||
@ -416,9 +407,17 @@ geometry_start_element_callback (GMarkupParseContext *pcontext,
|
||||
"no \"name\" attribute for \"key\"");
|
||||
return;
|
||||
}
|
||||
gchar *name = g_strdup (attribute);
|
||||
|
||||
attribute = get_attribute (attribute_names, attribute_values,
|
||||
"keycode");
|
||||
if (attribute != NULL)
|
||||
keycode = strtol (attribute, NULL, 10);
|
||||
else
|
||||
keycode = data->keycode++;
|
||||
|
||||
data->key = eek_section_create_key (data->section,
|
||||
g_strdup (attribute),
|
||||
name,
|
||||
keycode,
|
||||
data->num_columns,
|
||||
data->num_rows - 1);
|
||||
@ -727,7 +726,6 @@ symbols_end_element_callback (GMarkupParseContext *pcontext,
|
||||
gint levels = num_symbols / data->groups;
|
||||
EekSymbolMatrix *matrix = eek_symbol_matrix_new (data->groups,
|
||||
levels);
|
||||
|
||||
head = data->symbols = g_slist_reverse (data->symbols);
|
||||
for (i = 0; i < num_symbols; i++) {
|
||||
if (head && head->data) {
|
||||
|
||||
39
eek/keymap.h
Normal file
39
eek/keymap.h
Normal file
@ -0,0 +1,39 @@
|
||||
#include <gdk/gdk.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
gboolean
|
||||
squeek_keymap_get_entries_for_keyval (struct xkb_keymap *xkb_keymap,
|
||||
guint keyval,
|
||||
GdkKeymapKey **keys,
|
||||
guint *n_keys);
|
||||
|
||||
static const char *keymap_header = "xkb_keymap {\n\
|
||||
\n";
|
||||
|
||||
static const char *keymap_keycodes_header = "\
|
||||
xkb_keycodes \"squeekboard\" {\n\n\
|
||||
minimum = 8;\n\
|
||||
maximum = 255;\n\
|
||||
\n";
|
||||
|
||||
static const char *keymap_symbols_header = "\
|
||||
xkb_symbols \"squeekboard\" {\n\
|
||||
\n\
|
||||
name[Group1] = \"Letters\";\n\
|
||||
name[Group2] = \"Numbers/Symbols\";\n\
|
||||
\n";
|
||||
|
||||
static const char *keymap_footer = "\
|
||||
xkb_types \"squeekboard\" {\n\
|
||||
\n\
|
||||
type \"TWO_LEVEL\" {\n\
|
||||
modifiers = Shift;\n\
|
||||
map[Shift] = Level2;\n\
|
||||
level_name[Level1] = \"Base\";\n\
|
||||
level_name[Level2] = \"Shift\";\n\
|
||||
};\n\
|
||||
};\n\
|
||||
\n\
|
||||
xkb_compatibility \"squeekboard\" {\n\
|
||||
};\n\
|
||||
};";
|
||||
@ -28,7 +28,6 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "eekboard/eekboard-context-service.h"
|
||||
#include "keymap.h"
|
||||
|
||||
#include <fcntl.h>
|
||||
#include <stdio.h>
|
||||
@ -85,55 +84,6 @@ struct _EekboardContextServicePrivate {
|
||||
|
||||
G_DEFINE_TYPE_WITH_PRIVATE (EekboardContextService, eekboard_context_service, G_TYPE_OBJECT);
|
||||
|
||||
/*static Display *display = NULL; */
|
||||
gchar *
|
||||
get_keymap_from_resource(const gchar *keyboard_type, gboolean fallback)
|
||||
{
|
||||
g_autoptr (GFile) file = NULL;
|
||||
g_autoptr (GFileInfo) info = NULL;
|
||||
g_autoptr (GFileInputStream) stream = NULL;
|
||||
goffset size = 0;
|
||||
gsize bytes_read = 0;
|
||||
g_autofree gchar *contents = NULL;
|
||||
g_autofree gchar *path = NULL;
|
||||
GError *error = NULL;
|
||||
|
||||
if (fallback)
|
||||
g_debug ("falling back to loading a %s keymap", keyboard_type);
|
||||
|
||||
path = g_strconcat ("resource:///sm/puri/squeekboard/keyboards/keymaps/",
|
||||
keyboard_type, ".xkb", NULL);
|
||||
file = g_file_new_for_uri (path);
|
||||
stream = g_file_read (file, NULL, &error);
|
||||
|
||||
if (!stream)
|
||||
goto keymap_error;
|
||||
|
||||
info = g_file_input_stream_query_info (stream,
|
||||
G_FILE_ATTRIBUTE_STANDARD_SIZE,
|
||||
NULL,
|
||||
&error);
|
||||
|
||||
if (!info)
|
||||
goto keymap_error;
|
||||
|
||||
size = g_file_info_get_size (info);
|
||||
contents = g_malloc0 (size);
|
||||
|
||||
if (!g_input_stream_read_all (G_INPUT_STREAM(stream), contents, size,
|
||||
&bytes_read, NULL, &error))
|
||||
goto keymap_error;
|
||||
|
||||
return g_utf8_make_valid (contents, size);
|
||||
|
||||
keymap_error:
|
||||
if (fallback)
|
||||
g_error ("failed to load keymap from resource: %s", error->message);
|
||||
|
||||
g_error_free (error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static EekKeyboard *
|
||||
eekboard_context_service_real_create_keyboard (EekboardContextService *self,
|
||||
const gchar *keyboard_type)
|
||||
@ -193,13 +143,8 @@ eekboard_context_service_real_create_keyboard (EekboardContextService *self,
|
||||
if (!context) {
|
||||
g_error("No context created");
|
||||
}
|
||||
/*
|
||||
struct xkb_rule_names rules = { 0 };
|
||||
rules.layout = strdup(keyboard_type);
|
||||
*/
|
||||
char *keymap_str = get_keymap_from_resource(keyboard_type, FALSE);
|
||||
if (!keymap_str)
|
||||
keymap_str = get_keymap_from_resource("us", TRUE);
|
||||
|
||||
gchar *keymap_str = eek_keyboard_get_keymap(keyboard);
|
||||
|
||||
struct xkb_keymap *keymap = xkb_keymap_new_from_string(context, keymap_str,
|
||||
XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||
|
||||
@ -20,7 +20,6 @@
|
||||
/* This file is responsible for managing keycode data and emitting keycodes. */
|
||||
|
||||
#include "eekboard/key-emitter.h"
|
||||
#include "eekboard/keymap.h"
|
||||
|
||||
#include <gdk/gdk.h>
|
||||
|
||||
@ -39,98 +38,6 @@ typedef struct {
|
||||
} SeatEmitter;
|
||||
|
||||
|
||||
/* The following functions for keyboard mapping change are direct
|
||||
translation of the code in Caribou (in libcaribou/xadapter.vala):
|
||||
|
||||
- get_replaced_keycode (Caribou: get_reserved_keycode)
|
||||
- replace_keycode
|
||||
- get_keycode_from_gdk_keymap (Caribou: best_keycode_keyval_match)
|
||||
*/
|
||||
|
||||
/* Find an unused keycode where a keysym can be assigned. Restricted to Level 1 */
|
||||
static guint
|
||||
get_replaced_keycode (SeatEmitter *client)
|
||||
{
|
||||
guint keycode;
|
||||
return 0; // FIXME: no xkb allocated yet
|
||||
for (keycode = client->xkb->max_key_code;
|
||||
keycode >= client->xkb->min_key_code;
|
||||
--keycode) {
|
||||
guint offset = client->xkb->map->key_sym_map[keycode].offset;
|
||||
if (client->xkb->map->key_sym_map[keycode].kt_index[0] == XkbOneLevelIndex &&
|
||||
client->xkb->map->syms[offset] != NoSymbol) {
|
||||
return keycode;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Replace keysym assigned to KEYCODE to KEYSYM. Both args are used
|
||||
as in-out. If KEYCODE points to 0, this function picks a keycode
|
||||
from the current map and replace the associated keysym to KEYSYM.
|
||||
In that case, the replaced keycode is stored in KEYCODE and the old
|
||||
keysym is stored in KEYSYM. If otherwise (KEYCODE points to
|
||||
non-zero keycode), it simply changes the current map with the
|
||||
specified KEYCODE and KEYSYM. */
|
||||
static gboolean
|
||||
replace_keycode (SeatEmitter *emitter,
|
||||
guint keycode,
|
||||
guint *keysym)
|
||||
{
|
||||
/* GdkDisplay *display = gdk_display_get_default ();
|
||||
Display *xdisplay = GDK_DISPLAY_XDISPLAY (display);
|
||||
guint old_keysym;
|
||||
int keysyms_per_keycode;
|
||||
KeySym *syms;
|
||||
*/
|
||||
return TRUE; // FIXME: no xkb allocated at the moment, pretending all is fine
|
||||
g_return_val_if_fail (emitter->xkb->min_key_code <= keycode &&
|
||||
keycode <= emitter->xkb->max_key_code,
|
||||
FALSE);
|
||||
g_return_val_if_fail (keysym != NULL, FALSE);
|
||||
/*
|
||||
* Update keyboard mapping. Wayland receives keyboard mapping as a string, so XChangeKeyboardMapping needs to translate from the symbol tbale t the string. TODO.
|
||||
*
|
||||
syms = XGetKeyboardMapping (xdisplay, keycode, 1, &keysyms_per_keycode);
|
||||
old_keysym = syms[0];
|
||||
syms[0] = *keysym;
|
||||
XChangeKeyboardMapping (xdisplay, keycode, 1, syms, 1);
|
||||
XSync (xdisplay, False);
|
||||
XFree (syms);
|
||||
*keysym = old_keysym;
|
||||
*/
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static gboolean
|
||||
get_keycode_from_gdk_keymap (SeatEmitter *emitter,
|
||||
guint keysym,
|
||||
guint *keycode,
|
||||
guint *modifiers)
|
||||
{
|
||||
GdkKeymapKey *keys, *best_match = NULL;
|
||||
guint n_keys, i;
|
||||
|
||||
if (!squeek_keymap_get_entries_for_keyval (emitter->keymap, keysym, &keys, &n_keys))
|
||||
return FALSE;
|
||||
|
||||
for (i = 0; i < n_keys; i++)
|
||||
if ((guint)keys[i].group == emitter->group)
|
||||
best_match = &keys[i];
|
||||
|
||||
if (!best_match) {
|
||||
g_free (keys);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
*keycode = best_match->keycode;
|
||||
*modifiers = best_match->level == 1 ? EEK_SHIFT_MASK : 0;
|
||||
|
||||
g_free (keys);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
int send_virtual_keyboard_key(
|
||||
struct zwp_virtual_keyboard_v1 *keyboard,
|
||||
unsigned int keycode,
|
||||
@ -161,95 +68,6 @@ send_fake_modifiers_events (SeatEmitter *emitter,
|
||||
zwp_virtual_keyboard_v1_modifiers(emitter->virtual_keyboard, proto_modifiers, 0, 0, emitter->group);
|
||||
}
|
||||
|
||||
static void
|
||||
send_fake_key_event (SeatEmitter *emitter,
|
||||
guint xkeysym,
|
||||
guint keyboard_modifiers,
|
||||
gboolean pressed,
|
||||
uint32_t timestamp)
|
||||
{
|
||||
EekModifierType modifiers;
|
||||
guint old_keysym = xkeysym;
|
||||
|
||||
g_return_if_fail (xkeysym > 0);
|
||||
|
||||
guint keycode;
|
||||
if (!get_keycode_from_gdk_keymap (emitter, xkeysym, &keycode, &modifiers)) {
|
||||
keycode = get_replaced_keycode (emitter);
|
||||
if (keycode == 0) {
|
||||
g_warning ("no available keycode to replace");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!replace_keycode (emitter, keycode, &old_keysym)) {
|
||||
g_warning ("failed to lookup X keysym %X", xkeysym);
|
||||
return;
|
||||
}
|
||||
}
|
||||
/* Clear level shift modifiers */
|
||||
keyboard_modifiers &= (unsigned)~EEK_SHIFT_MASK;
|
||||
keyboard_modifiers &= (unsigned)~EEK_LOCK_MASK;
|
||||
/* FIXME: may need to remap ISO_Level3_Shift and NumLock */
|
||||
|
||||
modifiers |= keyboard_modifiers;
|
||||
|
||||
send_fake_modifiers_events (emitter, modifiers, timestamp);
|
||||
|
||||
// There's something magical about subtracting/adding 8 to keycodes for some reason
|
||||
send_virtual_keyboard_key (emitter->virtual_keyboard, keycode - 8, (unsigned)pressed, timestamp);
|
||||
send_fake_modifiers_events (emitter, modifiers, timestamp);
|
||||
|
||||
if (old_keysym != xkeysym)
|
||||
replace_keycode (emitter, keycode, &old_keysym);
|
||||
}
|
||||
|
||||
static void
|
||||
send_fake_key_events (SeatEmitter *emitter,
|
||||
EekSymbol *symbol,
|
||||
EekModifierType keyboard_modifiers,
|
||||
gboolean pressed,
|
||||
uint32_t timestamp)
|
||||
{
|
||||
/* Ignore modifier keys */
|
||||
if (eek_symbol_is_modifier (symbol))
|
||||
return;
|
||||
|
||||
/* If symbol is a text, convert chars in it to keysym */
|
||||
if (EEK_IS_TEXT(symbol)) {
|
||||
const gchar *utf8 = eek_text_get_text (EEK_TEXT(symbol));
|
||||
printf("Attempting to send text %s\n", utf8);
|
||||
/* FIXME:
|
||||
glong items_written;
|
||||
gunichar *ucs4 = g_utf8_to_ucs4_fast (utf8, -1, &items_written);
|
||||
gint i;
|
||||
|
||||
for (i = 0; i < items_written; i++) {
|
||||
guint xkeysym;
|
||||
EekKeysym *keysym;
|
||||
gchar *name;
|
||||
|
||||
name = g_strdup_printf ("U%04X", ucs4[i]);
|
||||
xkeysym = XStringToKeysym (name); // TODO: use xkb_get_keysym_from_name
|
||||
g_free (name);
|
||||
|
||||
keysym = eek_keysym_new (xkeysym);
|
||||
send_fake_key_events (client,
|
||||
EEK_SYMBOL(keysym),
|
||||
keyboard_modifiers);
|
||||
}
|
||||
g_free (ucs4);
|
||||
*/
|
||||
return;
|
||||
}
|
||||
|
||||
if (EEK_IS_KEYSYM(symbol)) {
|
||||
guint xkeysym = eek_keysym_get_xkeysym (EEK_KEYSYM(symbol));
|
||||
send_fake_key_event (emitter, xkeysym, keyboard_modifiers, pressed, timestamp);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/* Finds the first key code for each modifier and saves it in modifier_keycodes */
|
||||
static void
|
||||
update_modifier_info (SeatEmitter *client)
|
||||
|
||||
@ -1,66 +0,0 @@
|
||||
/* GDK - The GIMP Drawing Kit
|
||||
* Copyright (C) 2000 Red Hat, Inc.
|
||||
* Copyright (C) 2019 Purism, SPC
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2 of the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
/*
|
||||
* Modified for squeekboard based on GTK
|
||||
*/
|
||||
|
||||
#include "keymap.h"
|
||||
|
||||
gboolean
|
||||
squeek_keymap_get_entries_for_keyval (struct xkb_keymap *xkb_keymap,
|
||||
guint keyval,
|
||||
GdkKeymapKey **keys,
|
||||
guint *n_keys)
|
||||
{
|
||||
GArray *retval;
|
||||
guint keycode;
|
||||
xkb_keycode_t min_keycode, max_keycode;
|
||||
retval = g_array_new (FALSE, FALSE, sizeof (GdkKeymapKey));
|
||||
min_keycode = xkb_keymap_min_keycode (xkb_keymap);
|
||||
max_keycode = xkb_keymap_max_keycode (xkb_keymap);
|
||||
for (keycode = min_keycode; keycode < max_keycode; keycode++)
|
||||
{
|
||||
xkb_layout_index_t num_layouts, layout;
|
||||
num_layouts = xkb_keymap_num_layouts_for_key (xkb_keymap, keycode);
|
||||
for (layout = 0; layout < num_layouts; layout++)
|
||||
{
|
||||
xkb_layout_index_t num_levels, level;
|
||||
num_levels = xkb_keymap_num_levels_for_key (xkb_keymap, keycode, layout);
|
||||
for (level = 0; level < num_levels; level++)
|
||||
{
|
||||
const xkb_keysym_t *syms;
|
||||
gint num_syms, sym;
|
||||
num_syms = xkb_keymap_key_get_syms_by_level (xkb_keymap, keycode, layout, level, &syms);
|
||||
for (sym = 0; sym < num_syms; sym++)
|
||||
{
|
||||
if (syms[sym] == keyval)
|
||||
{
|
||||
GdkKeymapKey key;
|
||||
key.keycode = keycode;
|
||||
key.group = (gint)layout;
|
||||
key.level = (gint)level;
|
||||
g_array_append_val (retval, key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
*n_keys = retval->len;
|
||||
*keys = (GdkKeymapKey*) g_array_free (retval, FALSE);
|
||||
return TRUE;
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
#include <gdk/gdk.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
gboolean
|
||||
squeek_keymap_get_entries_for_keyval (struct xkb_keymap *xkb_keymap,
|
||||
guint keyval,
|
||||
GdkKeymapKey **keys,
|
||||
guint *n_keys);
|
||||
@ -40,7 +40,6 @@ sources = [
|
||||
enums,
|
||||
keysym_entries,
|
||||
marshalers,
|
||||
'../eekboard/keymap.c',
|
||||
'../eekboard/key-emitter.c',
|
||||
'../eekboard/eekboard-context-service.c',
|
||||
'../eekboard/eekboard-context.c',
|
||||
|
||||
@ -39,7 +39,7 @@ test_create (void)
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
gtk_test_init (&argc, &argv, NULL);
|
||||
g_test_add_func ("/eek-simple-test/create", test_create);
|
||||
return g_test_run ();
|
||||
}
|
||||
|
||||
@ -46,8 +46,7 @@ test_output_parse (void)
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
g_test_init (&argc, &argv, NULL);
|
||||
gtk_init (&argc, &argv); /* for gdk_x11_display_get_xdisplay() */
|
||||
gtk_test_init (&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func ("/eek-xml-test/output-parse", test_output_parse);
|
||||
|
||||
|
||||
@ -21,7 +21,8 @@ test_link_args = [
|
||||
|
||||
tests = [
|
||||
'eek-simple-test',
|
||||
'eek-xml-test'
|
||||
'eek-xml-test',
|
||||
'test-keymap-generation'
|
||||
]
|
||||
|
||||
foreach name : tests
|
||||
|
||||
@ -1,181 +0,0 @@
|
||||
<?xml version="1.0"?>
|
||||
<keyboard version="0.90">
|
||||
<bounds>0.000000,0.000000,124.000000,149.000000</bounds>
|
||||
<section name="Keypad">
|
||||
<bounds>10.000000,10.000000,104.000000,129.000000</bounds>
|
||||
<angle>0</angle>
|
||||
<row>
|
||||
<columns>4</columns>
|
||||
<orientation>1</orientation>
|
||||
</row>
|
||||
<row>
|
||||
<columns>4</columns>
|
||||
<orientation>1</orientation>
|
||||
</row>
|
||||
<row>
|
||||
<columns>3</columns>
|
||||
<orientation>1</orientation>
|
||||
</row>
|
||||
<row>
|
||||
<columns>4</columns>
|
||||
<orientation>1</orientation>
|
||||
</row>
|
||||
<row>
|
||||
<columns>2</columns>
|
||||
<orientation>1</orientation>
|
||||
</row>
|
||||
<key id="keycode91" name="KPDL" column="1" row="4">
|
||||
<bounds>54.000000,104.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65439">KP_Delete</keysym>
|
||||
<keysym keyval="65454">KP_Decimal</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode90" name="KP0" column="0" row="4">
|
||||
<bounds>2.000000,104.000000,50.000000,24.000000</bounds>
|
||||
<outline-ref>outline1</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65438">KP_Insert</keysym>
|
||||
<keysym keyval="65456">KP_0</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode108" name="KPEN" column="3" row="3">
|
||||
<bounds>80.000000,78.000000,24.000000,50.000000</bounds>
|
||||
<outline-ref>outline2</outline-ref>
|
||||
<symbols groups="1" levels="1">
|
||||
<keysym keyval="65421">KP_Enter</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode89" name="KP3" column="2" row="3">
|
||||
<bounds>54.000000,78.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65435">KP_Next</keysym>
|
||||
<keysym keyval="65459">KP_3</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode88" name="KP2" column="1" row="3">
|
||||
<bounds>28.000000,78.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65433">KP_Down</keysym>
|
||||
<keysym keyval="65458">KP_2</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode87" name="KP1" column="0" row="3">
|
||||
<bounds>2.000000,78.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65436">KP_End</keysym>
|
||||
<keysym keyval="65457">KP_1</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode85" name="KP6" column="2" row="2">
|
||||
<bounds>54.000000,53.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65432">KP_Right</keysym>
|
||||
<keysym keyval="65462">KP_6</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode84" name="KP5" column="1" row="2">
|
||||
<bounds>28.000000,53.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65437">KP_Begin</keysym>
|
||||
<keysym keyval="65461">KP_5</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode83" name="KP4" column="0" row="2">
|
||||
<bounds>2.000000,53.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65430">KP_Left</keysym>
|
||||
<keysym keyval="65460">KP_4</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode86" name="KPAD" column="3" row="1">
|
||||
<bounds>80.000000,27.000000,24.000000,50.000000</bounds>
|
||||
<outline-ref>outline2</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65451">KP_Add</keysym>
|
||||
<keysym keyval="269024802"></keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode81" name="KP9" column="2" row="1">
|
||||
<bounds>54.000000,27.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65434">KP_Prior</keysym>
|
||||
<keysym keyval="65465">KP_9</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode80" name="KP8" column="1" row="1">
|
||||
<bounds>28.000000,27.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65431">KP_Up</keysym>
|
||||
<keysym keyval="65464">KP_8</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode79" name="KP7" column="0" row="1">
|
||||
<bounds>2.000000,27.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65429">KP_Home</keysym>
|
||||
<keysym keyval="65463">KP_7</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode82" name="KPSU" column="3" row="0">
|
||||
<bounds>80.000000,1.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65453">KP_Subtract</keysym>
|
||||
<keysym keyval="269024803"></keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode63" name="KPMU" column="2" row="0">
|
||||
<bounds>54.000000,1.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65450">KP_Multiply</keysym>
|
||||
<keysym keyval="269024801"></keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode112" name="KPDV" column="1" row="0">
|
||||
<bounds>28.000000,1.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65455">KP_Divide</keysym>
|
||||
<keysym keyval="269024800"></keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
<key id="keycode77" name="NMLK" column="0" row="0">
|
||||
<bounds>2.000000,1.000000,24.000000,24.000000</bounds>
|
||||
<outline-ref>outline0</outline-ref>
|
||||
<symbols groups="1" levels="2">
|
||||
<keysym keyval="65407">Num_Lock</keysym>
|
||||
<keysym keyval="65273">Pointer_EnableKeys</keysym>
|
||||
</symbols>
|
||||
</key>
|
||||
</section>
|
||||
<outline id="outline0">
|
||||
<point>0.000000,0.000000</point>
|
||||
<point>24.000000,0.000000</point>
|
||||
<point>24.000000,24.000000</point>
|
||||
<point>0.000000,24.000000</point>
|
||||
</outline>
|
||||
<outline id="outline1">
|
||||
<point>0.000000,0.000000</point>
|
||||
<point>50.000000,0.000000</point>
|
||||
<point>50.000000,24.000000</point>
|
||||
<point>0.000000,24.000000</point>
|
||||
</outline>
|
||||
<outline id="outline2">
|
||||
<point>0.000000,0.000000</point>
|
||||
<point>24.000000,0.000000</point>
|
||||
<point>24.000000,50.000000</point>
|
||||
<point>0.000000,50.000000</point>
|
||||
</outline>
|
||||
</keyboard>
|
||||
71
tests/test-keymap-generation.c
Normal file
71
tests/test-keymap-generation.c
Normal file
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright (C) 2010-2011 Daiki Ueno <ueno@unixuser.org>
|
||||
* Copyright (C) 2010-2011 Red Hat, Inc.
|
||||
* Copyright (C) 2019 Purism SPC
|
||||
*
|
||||
* This library is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public License
|
||||
* as published by the Free Software Foundation; either version 2 of
|
||||
* the License, or (at your option) any later version.
|
||||
*
|
||||
* This library is distributed in the hope that it will be useful, but
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this library; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
* 02110-1301 USA
|
||||
*/
|
||||
|
||||
/* For gdk_x11_display_get_xdisplay(). See main(). */
|
||||
#include <gtk/gtk.h>
|
||||
#include <xkbcommon/xkbcommon.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "eek/eek.h"
|
||||
|
||||
static void
|
||||
test_check_xkb (void)
|
||||
{
|
||||
EekLayout *layout;
|
||||
EekKeyboard *keyboard;
|
||||
GError *error;
|
||||
|
||||
error = NULL;
|
||||
layout = eek_xml_layout_new ("us", &error);
|
||||
g_assert_no_error (error);
|
||||
|
||||
keyboard = eek_keyboard_new (NULL, layout, 640, 480);
|
||||
gchar *keymap_str = eek_keyboard_get_keymap(keyboard);
|
||||
|
||||
struct xkb_context *context = xkb_context_new(XKB_CONTEXT_NO_FLAGS);
|
||||
if (!context) {
|
||||
g_error("No context created");
|
||||
}
|
||||
|
||||
struct xkb_keymap *keymap = xkb_keymap_new_from_string(context, keymap_str,
|
||||
XKB_KEYMAP_FORMAT_TEXT_V1, XKB_KEYMAP_COMPILE_NO_FLAGS);
|
||||
|
||||
free(keymap_str);
|
||||
|
||||
xkb_context_unref(context);
|
||||
if (!keymap) {
|
||||
g_error("Bad keymap");
|
||||
}
|
||||
|
||||
g_object_unref (layout);
|
||||
g_object_unref (keyboard);
|
||||
}
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
gtk_test_init (&argc, &argv, NULL);
|
||||
|
||||
g_test_add_func ("/test-keymap-generation/check-xkb", test_check_xkb);
|
||||
|
||||
return g_test_run ();
|
||||
}
|
||||
Reference in New Issue
Block a user