Generate inscript keyboard on-the-fly.
This commit is contained in:
@ -25,6 +25,7 @@ Section = Eek.Section
|
|||||||
Key = Eek.Key
|
Key = Eek.Key
|
||||||
Symbol = Eek.Symbol
|
Symbol = Eek.Symbol
|
||||||
Keysym = Eek.Keysym
|
Keysym = Eek.Keysym
|
||||||
|
SymbolMatrix = Eek.SymbolMatrix
|
||||||
|
|
||||||
MODIFIER_BEHAVIOR_NONE, \
|
MODIFIER_BEHAVIOR_NONE, \
|
||||||
MODIFIER_BEHAVIOR_LOCK, \
|
MODIFIER_BEHAVIOR_LOCK, \
|
||||||
|
|||||||
@ -245,7 +245,9 @@ data/icons/32x32/Makefile
|
|||||||
data/icons/48x48/Makefile
|
data/icons/48x48/Makefile
|
||||||
data/icons/scalable/Makefile
|
data/icons/scalable/Makefile
|
||||||
data/themes/Makefile
|
data/themes/Makefile
|
||||||
|
data/keyboards/Makefile
|
||||||
examples/Makefile
|
examples/Makefile
|
||||||
|
examples/eekboard-inscript/Makefile
|
||||||
eek/eek-${EEK_API_VERSION}.pc
|
eek/eek-${EEK_API_VERSION}.pc
|
||||||
eek/eek-clutter-${EEK_API_VERSION}.pc
|
eek/eek-clutter-${EEK_API_VERSION}.pc
|
||||||
eek/eek-gtk-${EEK_API_VERSION}.pc
|
eek/eek-gtk-${EEK_API_VERSION}.pc
|
||||||
|
|||||||
@ -1 +1 @@
|
|||||||
SUBDIRS = icons themes
|
SUBDIRS = icons themes keyboards
|
||||||
|
|||||||
2
data/keyboards/Makefile.am
Normal file
2
data/keyboards/Makefile.am
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
keyboarddir = $(pkgdatadir)/keyboards
|
||||||
|
dist_keyboard_DATA = us-qwerty.xml
|
||||||
707
data/keyboards/us-qwerty.xml
Normal file
707
data/keyboards/us-qwerty.xml
Normal file
@ -0,0 +1,707 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<keyboard version="0.90">
|
||||||
|
<bounds>0.000000,0.000000,410.000000,190.000000</bounds>
|
||||||
|
<section name="Alpha">
|
||||||
|
<bounds>10.000000,50.000000,390.000000,129.000000</bounds>
|
||||||
|
<angle>0</angle>
|
||||||
|
<row>
|
||||||
|
<columns>14</columns>
|
||||||
|
<orientation>1</orientation>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<columns>14</columns>
|
||||||
|
<orientation>1</orientation>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<columns>13</columns>
|
||||||
|
<orientation>1</orientation>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<columns>12</columns>
|
||||||
|
<orientation>1</orientation>
|
||||||
|
</row>
|
||||||
|
<row>
|
||||||
|
<columns>8</columns>
|
||||||
|
<orientation>1</orientation>
|
||||||
|
</row>
|
||||||
|
<key id="keycode105" name="RCTL" column="7" row="4">
|
||||||
|
<bounds>359.000000,104.000000,31.000000,24.000000</bounds>
|
||||||
|
<oref>outline10</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="65508">Control_R</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode135" name="MENU" column="6" row="4">
|
||||||
|
<bounds>326.000000,104.000000,31.000000,24.000000</bounds>
|
||||||
|
<oref>outline10</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="65383">Menu</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode134" name="RWIN" column="5" row="4">
|
||||||
|
<bounds>294.000000,104.000000,31.000000,24.000000</bounds>
|
||||||
|
<oref>outline10</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="65516">Super_R</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode108" name="RALT" column="4" row="4">
|
||||||
|
<bounds>261.000000,104.000000,31.000000,24.000000</bounds>
|
||||||
|
<oref>outline10</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="65027">ISO_Level3_Shift</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode65" name="SPCE" column="3" row="4">
|
||||||
|
<bounds>106.000000,104.000000,153.000000,24.000000</bounds>
|
||||||
|
<oref>outline11</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="32">space</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode64" name="LALT" column="2" row="4">
|
||||||
|
<bounds>73.000000,104.000000,31.000000,24.000000</bounds>
|
||||||
|
<oref>outline10</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65513">Alt_L</keysym>
|
||||||
|
<keysym keyval="65511">Meta_L</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode133" name="LWIN" column="1" row="4">
|
||||||
|
<bounds>40.000000,104.000000,31.000000,24.000000</bounds>
|
||||||
|
<oref>outline10</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="65515">Super_L</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode37" name="LCTL" column="0" row="4">
|
||||||
|
<bounds>2.000000,104.000000,36.000000,24.000000</bounds>
|
||||||
|
<oref>outline9</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="65507">Control_L</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode62" name="RTSH" column="11" row="3">
|
||||||
|
<bounds>320.000000,78.000000,70.000000,24.000000</bounds>
|
||||||
|
<oref>outline8</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="65506">Shift_R</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode61" name="AB10" column="10" row="3">
|
||||||
|
<bounds>294.000000,78.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="47">slash</keysym>
|
||||||
|
<keysym keyval="63">question</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode60" name="AB09" column="9" row="3">
|
||||||
|
<bounds>268.000000,78.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="46">period</keysym>
|
||||||
|
<keysym keyval="62">greater</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode59" name="AB08" column="8" row="3">
|
||||||
|
<bounds>242.000000,78.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="44">comma</keysym>
|
||||||
|
<keysym keyval="60">less</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode58" name="AB07" column="7" row="3">
|
||||||
|
<bounds>216.000000,78.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="109">m</keysym>
|
||||||
|
<keysym keyval="77">M</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode57" name="AB06" column="6" row="3">
|
||||||
|
<bounds>190.000000,78.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="110">n</keysym>
|
||||||
|
<keysym keyval="78">N</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode56" name="AB05" column="5" row="3">
|
||||||
|
<bounds>164.000000,78.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="98">b</keysym>
|
||||||
|
<keysym keyval="66">B</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode55" name="AB04" column="4" row="3">
|
||||||
|
<bounds>138.000000,78.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="118">v</keysym>
|
||||||
|
<keysym keyval="86">V</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode54" name="AB03" column="3" row="3">
|
||||||
|
<bounds>113.000000,78.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="99">c</keysym>
|
||||||
|
<keysym keyval="67">C</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode53" name="AB02" column="2" row="3">
|
||||||
|
<bounds>87.000000,78.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="120">x</keysym>
|
||||||
|
<keysym keyval="88">X</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode52" name="AB01" column="1" row="3">
|
||||||
|
<bounds>61.000000,78.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="122">z</keysym>
|
||||||
|
<keysym keyval="90">Z</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode50" name="LFSH" column="0" row="3">
|
||||||
|
<bounds>2.000000,78.000000,57.000000,24.000000</bounds>
|
||||||
|
<oref>outline7</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="65505">Shift_L</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode36" name="RTRN" column="12" row="2">
|
||||||
|
<bounds>333.000000,53.000000,57.000000,24.000000</bounds>
|
||||||
|
<oref>outline6</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="65293">Return</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode48" name="AC11" column="11" row="2">
|
||||||
|
<bounds>307.000000,53.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="39">quoteright</keysym>
|
||||||
|
<keysym keyval="34">quotedbl</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode47" name="AC10" column="10" row="2">
|
||||||
|
<bounds>281.000000,53.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="59">semicolon</keysym>
|
||||||
|
<keysym keyval="58">colon</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode46" name="AC09" column="9" row="2">
|
||||||
|
<bounds>256.000000,53.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="108">l</keysym>
|
||||||
|
<keysym keyval="76">L</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode45" name="AC08" column="8" row="2">
|
||||||
|
<bounds>230.000000,53.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="107">k</keysym>
|
||||||
|
<keysym keyval="75">K</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode44" name="AC07" column="7" row="2">
|
||||||
|
<bounds>204.000000,53.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="106">j</keysym>
|
||||||
|
<keysym keyval="74">J</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode43" name="AC06" column="6" row="2">
|
||||||
|
<bounds>178.000000,53.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="104">h</keysym>
|
||||||
|
<keysym keyval="72">H</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode42" name="AC05" column="5" row="2">
|
||||||
|
<bounds>152.000000,53.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="103">g</keysym>
|
||||||
|
<keysym keyval="71">G</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode41" name="AC04" column="4" row="2">
|
||||||
|
<bounds>126.000000,53.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="102">f</keysym>
|
||||||
|
<keysym keyval="70">F</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode40" name="AC03" column="3" row="2">
|
||||||
|
<bounds>100.000000,53.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="100">d</keysym>
|
||||||
|
<keysym keyval="68">D</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode39" name="AC02" column="2" row="2">
|
||||||
|
<bounds>74.000000,53.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="115">s</keysym>
|
||||||
|
<keysym keyval="83">S</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode38" name="AC01" column="1" row="2">
|
||||||
|
<bounds>49.000000,53.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="97">a</keysym>
|
||||||
|
<keysym keyval="65">A</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode66" name="CAPS" column="0" row="2">
|
||||||
|
<bounds>2.000000,53.000000,44.000000,24.000000</bounds>
|
||||||
|
<oref>outline5</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65507">Control_L</keysym>
|
||||||
|
<keysym keyval="65507">Control_L</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode51" name="BKSL" column="13" row="1">
|
||||||
|
<bounds>352.000000,27.000000,38.000000,24.000000</bounds>
|
||||||
|
<oref>outline4</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="92">backslash</keysym>
|
||||||
|
<keysym keyval="124">bar</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode35" name="AD12" column="12" row="1">
|
||||||
|
<bounds>326.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="93">bracketright</keysym>
|
||||||
|
<keysym keyval="125">braceright</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode34" name="AD11" column="11" row="1">
|
||||||
|
<bounds>300.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="91">bracketleft</keysym>
|
||||||
|
<keysym keyval="123">braceleft</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode33" name="AD10" column="10" row="1">
|
||||||
|
<bounds>275.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="112">p</keysym>
|
||||||
|
<keysym keyval="80">P</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode32" name="AD09" column="9" row="1">
|
||||||
|
<bounds>249.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="111">o</keysym>
|
||||||
|
<keysym keyval="79">O</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode31" name="AD08" column="8" row="1">
|
||||||
|
<bounds>223.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="105">i</keysym>
|
||||||
|
<keysym keyval="73">I</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode30" name="AD07" column="7" row="1">
|
||||||
|
<bounds>197.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="117">u</keysym>
|
||||||
|
<keysym keyval="85">U</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode29" name="AD06" column="6" row="1">
|
||||||
|
<bounds>171.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="121">y</keysym>
|
||||||
|
<keysym keyval="89">Y</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode28" name="AD05" column="5" row="1">
|
||||||
|
<bounds>145.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="116">t</keysym>
|
||||||
|
<keysym keyval="84">T</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode27" name="AD04" column="4" row="1">
|
||||||
|
<bounds>119.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="114">r</keysym>
|
||||||
|
<keysym keyval="82">R</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode26" name="AD03" column="3" row="1">
|
||||||
|
<bounds>93.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="101">e</keysym>
|
||||||
|
<keysym keyval="69">E</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode25" name="AD02" column="2" row="1">
|
||||||
|
<bounds>68.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="119">w</keysym>
|
||||||
|
<keysym keyval="87">W</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode24" name="AD01" column="1" row="1">
|
||||||
|
<bounds>42.000000,27.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="113">q</keysym>
|
||||||
|
<keysym keyval="81">Q</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode23" name="TAB" column="0" row="1">
|
||||||
|
<bounds>2.000000,27.000000,38.000000,24.000000</bounds>
|
||||||
|
<oref>outline3</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65289">Tab</keysym>
|
||||||
|
<keysym keyval="65056">ISO_Left_Tab</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode22" name="BKSP" column="13" row="0">
|
||||||
|
<bounds>339.000000,1.000000,51.000000,24.000000</bounds>
|
||||||
|
<oref>outline2</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="65288">BackSpace</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode21" name="AE12" column="12" row="0">
|
||||||
|
<bounds>313.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="61">equal</keysym>
|
||||||
|
<keysym keyval="43">plus</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode20" name="AE11" column="11" row="0">
|
||||||
|
<bounds>287.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="45">minus</keysym>
|
||||||
|
<keysym keyval="95">underscore</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode19" name="AE10" column="10" row="0">
|
||||||
|
<bounds>261.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="48">0</keysym>
|
||||||
|
<keysym keyval="41">parenright</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode18" name="AE09" column="9" row="0">
|
||||||
|
<bounds>235.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="57">9</keysym>
|
||||||
|
<keysym keyval="40">parenleft</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode17" name="AE08" column="8" row="0">
|
||||||
|
<bounds>209.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="56">8</keysym>
|
||||||
|
<keysym keyval="42">asterisk</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode16" name="AE07" column="7" row="0">
|
||||||
|
<bounds>183.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="55">7</keysym>
|
||||||
|
<keysym keyval="38">ampersand</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode15" name="AE06" column="6" row="0">
|
||||||
|
<bounds>157.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="54">6</keysym>
|
||||||
|
<keysym keyval="94">asciicircum</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode14" name="AE05" column="5" row="0">
|
||||||
|
<bounds>132.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="53">5</keysym>
|
||||||
|
<keysym keyval="37">percent</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode13" name="AE04" column="4" row="0">
|
||||||
|
<bounds>106.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="52">4</keysym>
|
||||||
|
<keysym keyval="36">dollar</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode12" name="AE03" column="3" row="0">
|
||||||
|
<bounds>80.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="51">3</keysym>
|
||||||
|
<keysym keyval="35">numbersign</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode11" name="AE02" column="2" row="0">
|
||||||
|
<bounds>54.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="50">2</keysym>
|
||||||
|
<keysym keyval="64">at</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode10" name="AE01" column="1" row="0">
|
||||||
|
<bounds>28.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="49">1</keysym>
|
||||||
|
<keysym keyval="33">exclam</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode49" name="TLDE" column="0" row="0">
|
||||||
|
<bounds>2.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="96">quoteleft</keysym>
|
||||||
|
<keysym keyval="126">asciitilde</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
</section>
|
||||||
|
<section name="Function">
|
||||||
|
<bounds>10.000000,10.000000,410.000000,25.000000</bounds>
|
||||||
|
<angle>0</angle>
|
||||||
|
<row>
|
||||||
|
<columns>16</columns>
|
||||||
|
<orientation>1</orientation>
|
||||||
|
</row>
|
||||||
|
<key id="keycode96" name="FK12" column="12" row="0">
|
||||||
|
<bounds>366.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65481">F12</keysym>
|
||||||
|
<keysym keyval="269024780">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode95" name="FK11" column="11" row="0">
|
||||||
|
<bounds>340.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65480">F11</keysym>
|
||||||
|
<keysym keyval="269024779">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode76" name="FK10" column="10" row="0">
|
||||||
|
<bounds>314.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65479">F10</keysym>
|
||||||
|
<keysym keyval="269024778">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode75" name="FK09" column="9" row="0">
|
||||||
|
<bounds>288.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65478">F9</keysym>
|
||||||
|
<keysym keyval="269024777">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode74" name="FK08" column="8" row="0">
|
||||||
|
<bounds>249.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65477">F8</keysym>
|
||||||
|
<keysym keyval="269024776">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode73" name="FK07" column="7" row="0">
|
||||||
|
<bounds>223.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65476">F7</keysym>
|
||||||
|
<keysym keyval="269024775">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode72" name="FK06" column="6" row="0">
|
||||||
|
<bounds>197.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65475">F6</keysym>
|
||||||
|
<keysym keyval="269024774">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode71" name="FK05" column="5" row="0">
|
||||||
|
<bounds>171.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65474">F5</keysym>
|
||||||
|
<keysym keyval="269024773">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode70" name="FK04" column="4" row="0">
|
||||||
|
<bounds>132.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65473">F4</keysym>
|
||||||
|
<keysym keyval="269024772">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode69" name="FK03" column="3" row="0">
|
||||||
|
<bounds>106.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65472">F3</keysym>
|
||||||
|
<keysym keyval="269024771">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode68" name="FK02" column="2" row="0">
|
||||||
|
<bounds>80.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65471">F2</keysym>
|
||||||
|
<keysym keyval="269024770">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode67" name="FK01" column="1" row="0">
|
||||||
|
<bounds>54.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="2">
|
||||||
|
<keysym keyval="65470">F1</keysym>
|
||||||
|
<keysym keyval="269024769">(null)</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
<key id="keycode9" name="ESC" column="0" row="0">
|
||||||
|
<bounds>2.000000,1.000000,24.000000,24.000000</bounds>
|
||||||
|
<oref>outline1</oref>
|
||||||
|
<symbols groups="1" levels="1">
|
||||||
|
<keysym keyval="65307">Escape</keysym>
|
||||||
|
</symbols>
|
||||||
|
</key>
|
||||||
|
</section>
|
||||||
|
<outline id="outline1">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<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="outline3">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<point>0.000000,0.000000</point>
|
||||||
|
<point>38.000000,0.000000</point>
|
||||||
|
<point>38.000000,24.000000</point>
|
||||||
|
<point>0.000000,24.000000</point>
|
||||||
|
</outline>
|
||||||
|
<outline id="outline4">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<point>0.000000,0.000000</point>
|
||||||
|
<point>38.000000,0.000000</point>
|
||||||
|
<point>38.000000,24.000000</point>
|
||||||
|
<point>0.000000,24.000000</point>
|
||||||
|
</outline>
|
||||||
|
<outline id="outline5">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<point>0.000000,0.000000</point>
|
||||||
|
<point>44.000000,0.000000</point>
|
||||||
|
<point>44.000000,24.000000</point>
|
||||||
|
<point>0.000000,24.000000</point>
|
||||||
|
</outline>
|
||||||
|
<outline id="outline6">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<point>0.000000,0.000000</point>
|
||||||
|
<point>57.000000,0.000000</point>
|
||||||
|
<point>57.000000,24.000000</point>
|
||||||
|
<point>0.000000,24.000000</point>
|
||||||
|
</outline>
|
||||||
|
<outline id="outline7">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<point>0.000000,0.000000</point>
|
||||||
|
<point>57.000000,0.000000</point>
|
||||||
|
<point>57.000000,24.000000</point>
|
||||||
|
<point>0.000000,24.000000</point>
|
||||||
|
</outline>
|
||||||
|
<outline id="outline8">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<point>0.000000,0.000000</point>
|
||||||
|
<point>70.000000,0.000000</point>
|
||||||
|
<point>70.000000,24.000000</point>
|
||||||
|
<point>0.000000,24.000000</point>
|
||||||
|
</outline>
|
||||||
|
<outline id="outline9">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<point>0.000000,0.000000</point>
|
||||||
|
<point>36.000000,0.000000</point>
|
||||||
|
<point>36.000000,24.000000</point>
|
||||||
|
<point>0.000000,24.000000</point>
|
||||||
|
</outline>
|
||||||
|
<outline id="outline10">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<point>0.000000,0.000000</point>
|
||||||
|
<point>31.000000,0.000000</point>
|
||||||
|
<point>31.000000,24.000000</point>
|
||||||
|
<point>0.000000,24.000000</point>
|
||||||
|
</outline>
|
||||||
|
<outline id="outline11">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<point>0.000000,0.000000</point>
|
||||||
|
<point>153.000000,0.000000</point>
|
||||||
|
<point>153.000000,24.000000</point>
|
||||||
|
<point>0.000000,24.000000</point>
|
||||||
|
</outline>
|
||||||
|
<outline id="outline12">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<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>
|
||||||
|
<outline id="outline13">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<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">
|
||||||
|
<corner-radius>1.000000</corner-radius>
|
||||||
|
<point>0.000000,0.000000</point>
|
||||||
|
<point>51.000000,0.000000</point>
|
||||||
|
<point>51.000000,24.000000</point>
|
||||||
|
<point>0.000000,24.000000</point>
|
||||||
|
</outline>
|
||||||
|
</keyboard>
|
||||||
@ -1,8 +1 @@
|
|||||||
bin_SCRIPTS = eekboard-inscript
|
SUBDIRS = eekboard-inscript
|
||||||
keyboarddir = $(pkgdatadir)/keyboards
|
|
||||||
dist_keyboard_DATA = inscript2.xml
|
|
||||||
EXTRA_DIST = gen-inscript-keyboard.py
|
|
||||||
|
|
||||||
eekboard-inscript: eekboard-inscript.in
|
|
||||||
$(AM_V_GEN) sed 's!@EEKBOARD_INSCRIPT_PATH@!'$(pkgdatadir)/keyboards/inscript2.xml'!' < $< > $@
|
|
||||||
|
|
||||||
|
|||||||
@ -1,126 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
# Copyright (C) 2011 Daiki Ueno <ueno@unixuser.org>
|
|
||||||
# Copyright (C) 2011 Red Hat, Inc.
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
import gtk, eekboard, virtkey
|
|
||||||
|
|
||||||
GROUPS = (
|
|
||||||
"as-inscript2",
|
|
||||||
"bn-inscript2",
|
|
||||||
"brx-inscript2-deva",
|
|
||||||
"doi-inscript2-deva",
|
|
||||||
"gu-inscript2",
|
|
||||||
"hi-inscript2",
|
|
||||||
"kn-inscript2",
|
|
||||||
"kok-inscript2-deva",
|
|
||||||
"mai-inscript2",
|
|
||||||
"ml-inscript2",
|
|
||||||
"mni-inscript2-beng",
|
|
||||||
"mni-inscript2-mtei",
|
|
||||||
"mr-inscript2",
|
|
||||||
"ne-inscript2-deva",
|
|
||||||
"or-inscript2",
|
|
||||||
"pa-inscript2-guru",
|
|
||||||
"sa-inscript2",
|
|
||||||
"sat-inscript2-deva",
|
|
||||||
"sat-inscript2-olck",
|
|
||||||
"sd-inscript2-deva",
|
|
||||||
"ta-inscript2",
|
|
||||||
"te-inscript2")
|
|
||||||
|
|
||||||
class InscriptKeyboard(object):
|
|
||||||
def __init__(self, client_name, path):
|
|
||||||
self.__keyboard = eekboard.XmlKeyboard(path,
|
|
||||||
eekboard.MODIFIER_BEHAVIOR_LATCH)
|
|
||||||
self.__eekboard = eekboard.Eekboard()
|
|
||||||
self.__context = self.__eekboard.create_context(client_name)
|
|
||||||
keyboard_id = self.__context.add_keyboard(self.__keyboard)
|
|
||||||
self.__context.set_keyboard(keyboard_id)
|
|
||||||
self.__keyboard.connect('key-pressed', self.__key_pressed_cb)
|
|
||||||
self.__keyboard.connect('key-released', self.__key_released_cb)
|
|
||||||
self.__virtkey = virtkey.virtkey()
|
|
||||||
self.__english = False
|
|
||||||
self.__eekboard.connect('destroyed', self.__destroyed_cb)
|
|
||||||
|
|
||||||
def __destroyed_cb(self, eekboard):
|
|
||||||
gtk.main_quit()
|
|
||||||
|
|
||||||
def enable(self):
|
|
||||||
self.__eekboard.push_context(self.__context)
|
|
||||||
|
|
||||||
def disable(self):
|
|
||||||
self.__eekboard.pop_context(self.__context)
|
|
||||||
|
|
||||||
def show(self):
|
|
||||||
self.__context.show_keyboard()
|
|
||||||
|
|
||||||
def set_group(self, group):
|
|
||||||
self.__group = group
|
|
||||||
self.__context.set_group(self.__group)
|
|
||||||
|
|
||||||
def __key_pressed_cb(self, keyboard, key):
|
|
||||||
if key.get_keycode() == 37:
|
|
||||||
return
|
|
||||||
symbol = key.get_symbol()
|
|
||||||
if isinstance(symbol, eekboard.Keysym):
|
|
||||||
xkeysym = symbol.get_xkeysym()
|
|
||||||
modifiers = self.__keyboard.get_modifiers()
|
|
||||||
self.__virtkey.latch_mod(modifiers)
|
|
||||||
self.__virtkey.press_keysym(xkeysym)
|
|
||||||
self.__virtkey.unlatch_mod(modifiers)
|
|
||||||
|
|
||||||
def __key_released_cb(self, keyboard, key):
|
|
||||||
if key.get_keycode() == 37:
|
|
||||||
if self.__english:
|
|
||||||
self.__context.set_group(self.__group)
|
|
||||||
self.__english = False
|
|
||||||
else:
|
|
||||||
self.__context.set_group(0)
|
|
||||||
self.__english = True
|
|
||||||
return
|
|
||||||
symbol = key.get_symbol()
|
|
||||||
if isinstance(symbol, eekboard.Keysym):
|
|
||||||
xkeysym = symbol.get_xkeysym()
|
|
||||||
self.__virtkey.release_keysym(xkeysym)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
from optparse import OptionParser
|
|
||||||
import sys
|
|
||||||
|
|
||||||
parser = OptionParser()
|
|
||||||
parser.add_option("-n", "--name=LANGCODE", dest="langcode",
|
|
||||||
help="Specify language code to LANGCODE",
|
|
||||||
metavar="LANGCODE")
|
|
||||||
(options, args) = parser.parse_args()
|
|
||||||
group = 1
|
|
||||||
if options.langcode:
|
|
||||||
group = None
|
|
||||||
for index, langcode in enumerate(GROUPS):
|
|
||||||
if langcode.startswith(options.langcode):
|
|
||||||
group = index + 1
|
|
||||||
break
|
|
||||||
if group is None:
|
|
||||||
print >> sys.stderr, "Unknown langcode %s" % options.langcode
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
inscript = InscriptKeyboard("eekboard-inscript", "@EEKBOARD_INSCRIPT_PATH@")
|
|
||||||
inscript.set_group(group)
|
|
||||||
inscript.enable()
|
|
||||||
inscript.show()
|
|
||||||
gtk.main()
|
|
||||||
13
examples/eekboard-inscript/Makefile.am
Normal file
13
examples/eekboard-inscript/Makefile.am
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
bin_SCRIPTS = eekboard-inscript
|
||||||
|
keyboarddir = $(pkgdatadir)/keyboards
|
||||||
|
|
||||||
|
eekboard_inscript_datadir = $(datarootdir)/eekboard-inscript
|
||||||
|
eekboard_inscript_data_DATA = inscript.py main.py
|
||||||
|
|
||||||
|
eekboard-inscript: eekboard-inscript.in
|
||||||
|
$(AM_V_GEN) sed -e 's!@''PYTHON@!'$(PYTHON)'!' \
|
||||||
|
-e 's!@EEKBOARD_KEYBOARDDIR@!'$(keyboarddir)'!' \
|
||||||
|
-e 's!@M17N_DIR@!'$(datadir)/m17n'!' \
|
||||||
|
-e 's!@EEKBOARD_INSCRIPT_DATADIR@!'$(eekboard_inscript_datadir)'!' < $< > $@
|
||||||
|
|
||||||
|
CLEANFILES = eekboard-inscript
|
||||||
23
examples/eekboard-inscript/eekboard-inscript.in
Normal file
23
examples/eekboard-inscript/eekboard-inscript.in
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# Copyright (C) 2011 Daiki Ueno <ueno@unixuser.org>
|
||||||
|
# Copyright (C) 2011 Red Hat, Inc.
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
export EEKBOARD_KEYBOARDDIR=@EEKBOARD_KEYBOARDDIR@
|
||||||
|
export M17N_DIR=@M17N_DIR@
|
||||||
|
exec @PYTHON@ @EEKBOARD_INSCRIPT_DATADIR@/main.py $@
|
||||||
176
examples/eekboard-inscript/inscript.py
Normal file
176
examples/eekboard-inscript/inscript.py
Normal file
@ -0,0 +1,176 @@
|
|||||||
|
#!/usr/bin/env python
|
||||||
|
|
||||||
|
# Copyright (C) 2011 Daiki Ueno <ueno@unixuser.org>
|
||||||
|
# Copyright (C) 2011 Red Hat, Inc.
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
import gtk, eekboard, virtkey
|
||||||
|
import sys, os.path, re
|
||||||
|
|
||||||
|
KEYCODE_TABLE = {
|
||||||
|
'1': 10, '2': 11, '3': 12, '4': 13, '5': 14, '6': 15, '7': 16, '8': 17,
|
||||||
|
'9': 18, '0': 19, '-': 20, '=': 21, 'q': 24, 'w': 25, 'e': 26, 'r': 27,
|
||||||
|
't': 28, 'y': 29, 'u': 30, 'i': 31, 'o': 32, 'p': 33, '[': 34, ']': 35,
|
||||||
|
'a': 38, 's': 39, 'd': 40, 'f': 41, 'g': 42, 'h': 43, 'j': 44, 'k': 45,
|
||||||
|
'l': 46, ';': 47, '\'': 48, '`': 49, '\\': 51, 'z': 52, 'x': 53, 'c': 54,
|
||||||
|
'v': 55, 'b': 56, 'n': 57, 'm': 58, ',': 59, '.': 60, '/': 61
|
||||||
|
}
|
||||||
|
|
||||||
|
MARK_UPPER = '~!@#$%^&*()_+{}|:"<>?'
|
||||||
|
MARK_LOWER = '`1234567890-=[]\\;\',./'
|
||||||
|
|
||||||
|
class MapFile(object):
|
||||||
|
MAPENTRY_PATTERN = re.compile(r'\A\s*\((?:\((.*?)\)|"(.*?)")\s*"(.*?)"\)')
|
||||||
|
|
||||||
|
def __init__(self, path):
|
||||||
|
self.__dict = dict()
|
||||||
|
|
||||||
|
with open(path, 'r') as fp:
|
||||||
|
for line in fp:
|
||||||
|
match = re.match(self.MAPENTRY_PATTERN, line)
|
||||||
|
if match:
|
||||||
|
insert = match.group(3).decode('UTF-8')
|
||||||
|
if match.group(1):
|
||||||
|
keyseq = re.sub(r'\\(.)', r'\1', match.group(1))
|
||||||
|
self.__add_symbol_entry(keyseq, insert)
|
||||||
|
else:
|
||||||
|
keyseq = re.sub(r'\\(.)', r'\1', match.group(2))
|
||||||
|
self.__add_text_entry(keyseq, insert)
|
||||||
|
|
||||||
|
def get_entry_for_keycode(self, keycode):
|
||||||
|
return self.__dict.get(keycode)
|
||||||
|
|
||||||
|
def __add_entry(self, letter, level, insert):
|
||||||
|
if letter.isupper():
|
||||||
|
level |= 1
|
||||||
|
letter = letter.lower()
|
||||||
|
elif letter in MARK_UPPER:
|
||||||
|
level |= 1
|
||||||
|
letter = MARK_LOWER[MARK_UPPER.index(letter)]
|
||||||
|
keycode = KEYCODE_TABLE[letter]
|
||||||
|
if keycode not in self.__dict:
|
||||||
|
self.__dict[keycode] = list([None,None,None,None])
|
||||||
|
self.__dict[keycode][level] = insert
|
||||||
|
|
||||||
|
def __add_symbol_entry(self, symbol, insert):
|
||||||
|
level = 0
|
||||||
|
if symbol.startswith('G-'):
|
||||||
|
level |= 2
|
||||||
|
symbol = symbol[2:]
|
||||||
|
if not symbol.startswith('KP_'):
|
||||||
|
self.__add_entry(symbol, level, insert)
|
||||||
|
|
||||||
|
def __add_text_entry(self, text, insert):
|
||||||
|
self.__add_entry(text, 0, insert)
|
||||||
|
|
||||||
|
class Keyboard(object):
|
||||||
|
def __init__(self, client_name, map_path, kbd_path):
|
||||||
|
self.__keyboard = self.__create_keyboard(map_path, kbd_path)
|
||||||
|
self.__eekboard = eekboard.Eekboard()
|
||||||
|
self.__context = self.__eekboard.create_context(client_name)
|
||||||
|
keyboard_id = self.__context.add_keyboard(self.__keyboard)
|
||||||
|
self.__context.set_keyboard(keyboard_id)
|
||||||
|
self.__keyboard.connect('key-pressed', self.__key_pressed_cb)
|
||||||
|
self.__keyboard.connect('key-released', self.__key_released_cb)
|
||||||
|
self.__virtkey = virtkey.virtkey()
|
||||||
|
self.__english = False
|
||||||
|
self.__eekboard.connect('destroyed', self.__destroyed_cb)
|
||||||
|
|
||||||
|
def __create_keyboard(self, map_path, kbd_path):
|
||||||
|
def __each_key(element, data):
|
||||||
|
keycode = element.get_keycode()
|
||||||
|
# keycode 37 is used to toggle English/Inscript
|
||||||
|
if keycode == 37:
|
||||||
|
matrix = eekboard.SymbolMatrix.new(2, 1)
|
||||||
|
keysym = eekboard.Keysym.new(65507)
|
||||||
|
keysym.set_label("Ind")
|
||||||
|
matrix.set_symbol(0, 0, keysym)
|
||||||
|
keysym = eekboard.Keysym.new(65507)
|
||||||
|
keysym.set_label("Eng")
|
||||||
|
matrix.set_symbol(1, 0, keysym)
|
||||||
|
element.set_symbol_matrix(matrix)
|
||||||
|
return
|
||||||
|
|
||||||
|
# group(0) is us keyboard
|
||||||
|
matrix = eekboard.SymbolMatrix.new(2, 4)
|
||||||
|
for l in xrange(4):
|
||||||
|
keysym = element.get_symbol_at_index(0, l, 0, 0)
|
||||||
|
matrix.set_symbol(0, l, keysym)
|
||||||
|
# group(1) is inscript keyboard
|
||||||
|
entry = data.get_entry_for_keycode(keycode)
|
||||||
|
for l in xrange(4):
|
||||||
|
keysym = None
|
||||||
|
if entry and entry[l]:
|
||||||
|
try:
|
||||||
|
keyval = gtk.gdk.unicode_to_keyval(ord(entry[l]))
|
||||||
|
keysym = eekboard.Keysym.new(keyval)
|
||||||
|
except:
|
||||||
|
print >> sys.stderr, "can't convert %s to keyval" % entry[l]
|
||||||
|
if not keysym:
|
||||||
|
keysym = element.get_symbol_at_index(1, l, 0, 0)
|
||||||
|
matrix.set_symbol(1, l, keysym)
|
||||||
|
element.set_symbol_matrix(matrix)
|
||||||
|
|
||||||
|
def __each_section(element, data):
|
||||||
|
element.foreach_child(__each_key, data)
|
||||||
|
|
||||||
|
mapfile = MapFile(map_path)
|
||||||
|
keyboard = eekboard.XmlKeyboard(kbd_path,
|
||||||
|
eekboard.MODIFIER_BEHAVIOR_LATCH)
|
||||||
|
keyboard.foreach_child(__each_section, mapfile)
|
||||||
|
return keyboard
|
||||||
|
|
||||||
|
def __destroyed_cb(self, eekboard):
|
||||||
|
gtk.main_quit()
|
||||||
|
|
||||||
|
def enable(self):
|
||||||
|
self.__eekboard.push_context(self.__context)
|
||||||
|
|
||||||
|
def disable(self):
|
||||||
|
self.__eekboard.pop_context(self.__context)
|
||||||
|
|
||||||
|
def show(self):
|
||||||
|
self.__context.show_keyboard()
|
||||||
|
|
||||||
|
def set_group(self, group):
|
||||||
|
self.__group = group
|
||||||
|
self.__context.set_group(self.__group)
|
||||||
|
|
||||||
|
def __key_pressed_cb(self, keyboard, key):
|
||||||
|
if key.get_keycode() == 37:
|
||||||
|
return
|
||||||
|
symbol = key.get_symbol()
|
||||||
|
if isinstance(symbol, eekboard.Keysym):
|
||||||
|
xkeysym = symbol.get_xkeysym()
|
||||||
|
modifiers = self.__keyboard.get_modifiers()
|
||||||
|
self.__virtkey.latch_mod(modifiers)
|
||||||
|
self.__virtkey.press_keysym(xkeysym)
|
||||||
|
self.__virtkey.unlatch_mod(modifiers)
|
||||||
|
|
||||||
|
def __key_released_cb(self, keyboard, key):
|
||||||
|
if key.get_keycode() == 37:
|
||||||
|
if self.__english:
|
||||||
|
self.__context.set_group(self.__group)
|
||||||
|
self.__english = False
|
||||||
|
else:
|
||||||
|
self.__context.set_group(0)
|
||||||
|
self.__english = True
|
||||||
|
return
|
||||||
|
symbol = key.get_symbol()
|
||||||
|
if isinstance(symbol, eekboard.Keysym):
|
||||||
|
xkeysym = symbol.get_xkeysym()
|
||||||
|
self.__virtkey.release_keysym(xkeysym)
|
||||||
48
examples/eekboard-inscript/main.py
Normal file
48
examples/eekboard-inscript/main.py
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
# Copyright (C) 2011 Daiki Ueno <ueno@unixuser.org>
|
||||||
|
# Copyright (C) 2011 Red Hat, Inc.
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
|
import inscript
|
||||||
|
import gtk
|
||||||
|
from optparse import OptionParser
|
||||||
|
import sys, os
|
||||||
|
|
||||||
|
parser = OptionParser()
|
||||||
|
parser.add_option("-n", "--name=LANGCODE", dest="langcode",
|
||||||
|
help="Specify language code to LANGCODE",
|
||||||
|
metavar="LANGCODE")
|
||||||
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
|
if options.langcode is None:
|
||||||
|
print >> sys.stderr, "Specify language code with -n"
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
map_path = os.path.join(os.getenv("M17N_DIR"), options.langcode + ".mim")
|
||||||
|
if not os.path.exists(map_path):
|
||||||
|
print >> sys.stderr, "%s not found" % map_path
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
kbd_path = os.path.join(os.getenv("EEKBOARD_KEYBOARDDIR"), "us-qwerty.xml")
|
||||||
|
if not os.path.exists(kbd_path):
|
||||||
|
print >> sys.stderr, "%s not found" % kbd_path
|
||||||
|
exit(1)
|
||||||
|
|
||||||
|
keyboard = inscript.Keyboard("eekboard-inscript", map_path, kbd_path)
|
||||||
|
keyboard.set_group(1)
|
||||||
|
keyboard.enable()
|
||||||
|
keyboard.show()
|
||||||
|
gtk.main()
|
||||||
@ -1,162 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
|
|
||||||
# Copyright (C) 2011 Daiki Ueno <ueno@unixuser.org>
|
|
||||||
# Copyright (C) 2011 Red Hat, Inc.
|
|
||||||
|
|
||||||
# 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
|
|
||||||
|
|
||||||
import sys, os.path
|
|
||||||
import sys
|
|
||||||
import re
|
|
||||||
|
|
||||||
import gtk, gtk.gdk
|
|
||||||
import eekboard
|
|
||||||
from gi.repository import Eek, GLib
|
|
||||||
|
|
||||||
if len(sys.argv) < 3:
|
|
||||||
print >> sys.stderr, "Usage: %s KEYBOARD M17N-MAP..." % sys.argv[0]
|
|
||||||
sys.exit(-1)
|
|
||||||
|
|
||||||
MAPENTRY_PATTERN = re.compile(r'\A\s*\((?:\((.*?)\)|"(.*?)")\s*"(.*?)"\)')
|
|
||||||
KEYCODE_TABLE = {
|
|
||||||
'1': 10,
|
|
||||||
'2': 11,
|
|
||||||
'3': 12,
|
|
||||||
'4': 13,
|
|
||||||
'5': 14,
|
|
||||||
'6': 15,
|
|
||||||
'7': 16,
|
|
||||||
'8': 17,
|
|
||||||
'9': 18,
|
|
||||||
'0': 19,
|
|
||||||
'-': 20,
|
|
||||||
'=': 21,
|
|
||||||
'q': 24,
|
|
||||||
'w': 25,
|
|
||||||
'e': 26,
|
|
||||||
'r': 27,
|
|
||||||
't': 28,
|
|
||||||
'y': 29,
|
|
||||||
'u': 30,
|
|
||||||
'i': 31,
|
|
||||||
'o': 32,
|
|
||||||
'p': 33,
|
|
||||||
'[': 34,
|
|
||||||
']': 35,
|
|
||||||
'a': 38,
|
|
||||||
's': 39,
|
|
||||||
'd': 40,
|
|
||||||
'f': 41,
|
|
||||||
'g': 42,
|
|
||||||
'h': 43,
|
|
||||||
'j': 44,
|
|
||||||
'k': 45,
|
|
||||||
'l': 46,
|
|
||||||
';': 47,
|
|
||||||
'\'': 48,
|
|
||||||
'`': 49,
|
|
||||||
'\\': 51,
|
|
||||||
'z': 52,
|
|
||||||
'x': 53,
|
|
||||||
'c': 54,
|
|
||||||
'v': 55,
|
|
||||||
'b': 56,
|
|
||||||
'n': 57,
|
|
||||||
'm': 58,
|
|
||||||
',': 59,
|
|
||||||
'.': 60,
|
|
||||||
'/': 61
|
|
||||||
}
|
|
||||||
|
|
||||||
MARK_UPPER = '~!@#$%^&*()_+{}|:"<>?'
|
|
||||||
MARK_LOWER = '`1234567890-=[]\\;\',./'
|
|
||||||
|
|
||||||
class MapFile(object):
|
|
||||||
def __init__(self, path):
|
|
||||||
self.__dict = dict()
|
|
||||||
|
|
||||||
with open(path, 'r') as fp:
|
|
||||||
for line in fp:
|
|
||||||
match = re.match(MAPENTRY_PATTERN, line)
|
|
||||||
if match:
|
|
||||||
insert = match.group(3).decode('UTF-8')
|
|
||||||
if match.group(1):
|
|
||||||
keyseq = re.sub(r'\\(.)', r'\1', match.group(1))
|
|
||||||
self.__add_symbol_entry(keyseq, insert)
|
|
||||||
else:
|
|
||||||
keyseq = re.sub(r'\\(.)', r'\1', match.group(2))
|
|
||||||
self.__add_text_entry(keyseq, insert)
|
|
||||||
|
|
||||||
def get_entry_for_keycode(self, keycode):
|
|
||||||
return self.__dict.get(keycode, list([None, None, None, None]))
|
|
||||||
|
|
||||||
def __add_entry(self, letter, level, insert):
|
|
||||||
if letter.isupper():
|
|
||||||
level |= 1
|
|
||||||
letter = letter.lower()
|
|
||||||
elif letter in MARK_UPPER:
|
|
||||||
level |= 1
|
|
||||||
letter = MARK_LOWER[MARK_UPPER.index(letter)]
|
|
||||||
keycode = KEYCODE_TABLE[letter]
|
|
||||||
if keycode not in self.__dict:
|
|
||||||
self.__dict[keycode] = list([None,None,None,None])
|
|
||||||
self.__dict[keycode][level] = insert
|
|
||||||
|
|
||||||
def __add_symbol_entry(self, symbol, insert):
|
|
||||||
level = 0
|
|
||||||
if symbol.startswith('G-'):
|
|
||||||
level |= 2
|
|
||||||
symbol = symbol[2:]
|
|
||||||
if not symbol.startswith('KP_'):
|
|
||||||
self.__add_entry(symbol, level, insert)
|
|
||||||
|
|
||||||
def __add_text_entry(self, text, insert):
|
|
||||||
self.__add_entry(text, 0, insert)
|
|
||||||
|
|
||||||
files = list()
|
|
||||||
for path in sys.argv[2:]:
|
|
||||||
files.append(MapFile(path))
|
|
||||||
|
|
||||||
keyboard = eekboard.XmlKeyboard(os.path.abspath(sys.argv[1]))
|
|
||||||
|
|
||||||
def each_key(element, data):
|
|
||||||
keycode = element.get_keycode()
|
|
||||||
matrix = Eek.SymbolMatrix.new(len(files) + 1, 4)
|
|
||||||
for l in xrange(4):
|
|
||||||
keysym = element.get_symbol_at_index(0, l, 0, 0)
|
|
||||||
matrix.set_symbol(0, l, keysym)
|
|
||||||
for g, f in enumerate(files):
|
|
||||||
entry = f.get_entry_for_keycode(keycode)
|
|
||||||
for l in xrange(4):
|
|
||||||
keysym = None
|
|
||||||
if entry[l]:
|
|
||||||
try:
|
|
||||||
keyval = gtk.gdk.unicode_to_keyval(ord(entry[l]))
|
|
||||||
keysym = Eek.Keysym.new(keyval)
|
|
||||||
except:
|
|
||||||
pass
|
|
||||||
if not keysym:
|
|
||||||
keysym = element.get_symbol_at_index(g + 1, l, 0, 0)
|
|
||||||
matrix.set_symbol(g + 1, l, keysym)
|
|
||||||
element.set_symbol_matrix(matrix)
|
|
||||||
|
|
||||||
def each_section(element, data):
|
|
||||||
element.foreach_child(each_key, None)
|
|
||||||
|
|
||||||
keyboard.foreach_child(each_section, None)
|
|
||||||
output = GLib.string_sized_new(4096)
|
|
||||||
keyboard.output(output, 0)
|
|
||||||
print output.str
|
|
||||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user