Commit 5c929ff1 authored by Daiki Ueno's avatar Daiki Ueno
parent 33ad8a8b
......@@ -55,7 +55,7 @@
<key name="omacron"/>
</key>
<key name="p"/>
<key name="BackSpace"/>
<key name="BackSpace" repeatable="yes"/>
</row>
<row align="right">
<key name="Tab" width="1.5"/>
......@@ -100,7 +100,7 @@
<key align="left" name="Caribou_Symbols" toggle="symbols1" width="2.0"/>
<key align="left" name="Control_L" width="1.5"/>
<key align="left" name="Alt_L" width="1.5"/>
<key align="left" name="space" width="5.0"/>
<key align="left" name="space" width="5.0" repeatable="yes"/>
<key align="right" name="Caribou_Prefs"/>
</row>
</level>
......@@ -159,7 +159,7 @@
<key name="Omacron"/>
</key>
<key name="P"/>
<key name="BackSpace"/>
<key name="BackSpace" repeatable="yes"/>
</row>
<row align="right">
<key name="Tab" width="1.5"/>
......@@ -204,7 +204,7 @@
<key align="left" name="Caribou_Symbols" toggle="symbols1" width="2.0"/>
<key align="left" name="Control_L" width="1.5"/>
<key align="left" name="Alt_L" width="1.5"/>
<key align="left" name="space" width="5.0"/>
<key align="left" name="space" width="5.0" repeatable="yes"/>
<key align="right" name="Caribou_Prefs"/>
</row>
</level>
......
......@@ -27,7 +27,7 @@
<key name="8"/>
<key name="9"/>
<key name="0"/>
<key name="BackSpace"/>
<key name="BackSpace" repeatable="yes"/>
</row>
<row align="right">
<key name="Tab" width="1.5"/>
......@@ -61,7 +61,7 @@
<key align="left" name="Caribou_Alpha" toggle="default" width="2.0"/>
<key align="left" name="Control_L" width="1.5"/>
<key align="left" name="Alt_L" width="1.5"/>
<key align="left" name="space" width="5.0"/>
<key align="left" name="space" width="5.0" repeatable="yes"/>
<key align="right" name="Caribou_Prefs"/>
</row>
</level>
......@@ -92,7 +92,7 @@
<key name="asterisk"/>
<key name="plus"/>
<key name="equal"/>
<key name="BackSpace"/>
<key name="BackSpace" repeatable="yes"/>
</row>
<row align="right">
<key name="Tab" width="1.5"/>
......@@ -126,7 +126,7 @@
<key align="left" name="Caribou_Alpha" toggle="default" width="2.0"/>
<key align="left" name="Control_L" width="1.5"/>
<key align="left" name="Alt_L" width="1.5"/>
<key align="left" name="space" width="5.0"/>
<key align="left" name="space" width="5.0" repeatable="yes"/>
<key align="right" name="Caribou_Prefs"/>
</row>
</level>
......
......@@ -12,7 +12,7 @@
<key name="Arabic_khah"/>
<key name="Arabic_hah"/>
<key name="Arabic_jeem"/>
<key name="BackSpace"/>
<key name="BackSpace" repeatable="yes"/>
</row>
<row align="center">
<key name="Arabic_sheen"/>
......@@ -41,7 +41,7 @@
<row>
<key align="left" name="Caribou_Symbols" toggle="symbols1" width="2.0"/>
<key align="left" name="Arabic_fathatan"/>
<key align="left" name="space" width="6.0"/>
<key align="left" name="space" width="6.0" repeatable="yes"/>
<key align="right" name="Caribou_Prefs"/>
</row>
</level>
......
......@@ -40,7 +40,7 @@
<key name="omacron"/>
</key>
<key name="p"/>
<key name="BackSpace"/>
<key name="BackSpace" repeatable="yes"/>
</row>
<row align="right">
<key name="a">
......@@ -82,7 +82,7 @@
</row>
<row>
<key align="left" name="Caribou_Symbols" toggle="symbols1" width="2.0"/>
<key align="center" name="space" width="6.0"/>
<key align="center" name="space" width="6.0" repeatable="yes"/>
<key align="right" name="Caribou_Prefs"/>
</row>
</level>
......@@ -126,7 +126,7 @@
<key name="Omacron"/>
</key>
<key name="P"/>
<key name="BackSpace"/>
<key name="BackSpace" repeatable="yes"/>
</row>
<row align="right">
<key name="A">
......@@ -168,7 +168,7 @@
</row>
<row>
<key align="left" name="Caribou_Symbols" toggle="symbols1" width="2.0"/>
<key align="center" name="space" width="6.0"/>
<key align="center" name="space" width="6.0" repeatable="yes"/>
<key align="right" name="Caribou_Prefs"/>
</row>
</level>
......
......@@ -12,7 +12,7 @@
<key name="8"/>
<key name="9"/>
<key name="0"/>
<key name="BackSpace"/>
<key name="BackSpace" repeatable="yes"/>
</row>
<row align="right">
<key name="minus"/>
......@@ -43,7 +43,7 @@
</row>
<row>
<key align="left" name="Caribou_Alpha" toggle="default" width="2.0"/>
<key align="center" name="space" width="6.0"/>
<key align="center" name="space" width="6.0" repeatable="yes"/>
<key align="right" name="Caribou_Prefs"/>
</row>
</level>
......@@ -59,7 +59,7 @@
<key name="asterisk"/>
<key name="plus"/>
<key name="equal"/>
<key name="BackSpace"/>
<key name="BackSpace" repeatable="yes"/>
</row>
<row align="right">
<key align="right" name="underscore"/>
......@@ -90,7 +90,7 @@
</row>
<row>
<key align="left" name="Caribou_Alpha" toggle="default" width="2.0"/>
<key align="center" name="space" width="6.0"/>
<key align="center" name="space" width="6.0" repeatable="yes"/>
<key align="right" name="Caribou_Prefs"/>
</row>
</level>
......
......@@ -12,7 +12,7 @@
<key name="hebrew_finalnun"/>
<key name="hebrew_finalmem"/>
<key name="hebrew_pe"/>
<key name="BackSpace"/>
<key name="BackSpace" repeatable="yes"/>
</row>
<row align="center">
<key name="hebrew_shin"/>
......@@ -40,7 +40,7 @@
</row>
<row>
<key name="Caribou_Symbols" align="left" toggle="symbols1" width="2.0"/>
<key name="space" width="6.0" align="center"/>
<key name="space" width="6.0" align="center" repeatable="yes"/>
<key name="Caribou_Prefs" align="right"/>
</row>
</level>
......
......@@ -8,6 +8,7 @@ namespace Caribou {
public string align { get; set; default = "center"; }
public double width { get; set; default = 1.0; }
public string toggle { get; set; default = ""; }
public bool repeatable { get; set; default = false; }
private Gdk.ModifierType mod_mask;
public bool is_modifier {
......@@ -144,7 +145,12 @@ namespace Caribou {
modifier_state = ModifierState.NONE;
}
}
hold_tid = GLib.Timeout.add(1000, on_key_held);
if (repeatable)
xadapter.keyval_press (keyval);
else
hold_tid = GLib.Timeout.add (1000, on_key_held);
key_pressed(this);
}
......@@ -160,9 +166,13 @@ namespace Caribou {
}
}
foreach (var keyval in _keyvals) {
xadapter.keyval_press(keyval);
xadapter.keyval_release(keyval);
if (repeatable)
xadapter.keyval_release (keyval);
else {
foreach (var keyval in _keyvals) {
xadapter.keyval_press (keyval);
xadapter.keyval_release (keyval);
}
}
key_released(this);
......
......@@ -160,6 +160,8 @@ namespace Caribou {
key.align = prop->children->content;
else if (prop->name == "width")
key.width = double.parse (prop->children->content);
else if (prop->name == "repeatable" && text == null)
key.repeatable = prop->children->content == "yes";
}
for (Xml.Node* i = node->children; i != null; i = i->next) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment