matchbox-keyboard-inputmethod: Add support for bug20 layout
authorStefan Schmidt <stefan@buglabs.net>
Mon, 13 Dec 2010 14:07:57 +0000 (15:07 +0100)
committerStefan Schmidt <stefan@buglabs.net>
Thu, 16 Dec 2010 14:03:08 +0000 (15:03 +0100)
recipes/matchbox-keyboard/files/bug20/80matchboxkeyboard [new file with mode: 0644]
recipes/matchbox-keyboard/files/keyboard-bug.xml [new file with mode: 0644]
recipes/matchbox-keyboard/files/mb_kb_mods.patch [new file with mode: 0644]
recipes/matchbox-keyboard/files/mb_kbd_size.patch [new file with mode: 0644]
recipes/matchbox-keyboard/matchbox-keyboard-inputmethod_svn.bb

diff --git a/recipes/matchbox-keyboard/files/bug20/80matchboxkeyboard b/recipes/matchbox-keyboard/files/bug20/80matchboxkeyboard
new file mode 100644 (file)
index 0000000..21e78ac
--- /dev/null
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+CMD=""
+
+if [ "$DISPLAY_CAN_ROTATE" = "1" ]; then
+    if [ "$HAVE_KEYBOARD_PORTRAIT" = "1" -a "$HAVE_KEYBOARD_LANDSCAPE" = "0" ]; then
+        CMD="matchbox-keyboard -d -o landscape"
+    elif [ "$HAVE_KEYBOARD_LANDSCAPE" = "1" -a "$HAVE_KEYBOARD_PORTRAIT" = "0" ]; then
+        CMD="matchbox-keyboard -d -o portrait"
+    fi
+else
+    CMD="matchbox-keyboard -d"
+fi
+
+
+# Delay to make sure the window manager is active
+
+if [ "$CMD" ]; then
+    (sleep 2 && $CMD bug) &
+fi
diff --git a/recipes/matchbox-keyboard/files/keyboard-bug.xml b/recipes/matchbox-keyboard/files/keyboard-bug.xml
new file mode 100644 (file)
index 0000000..0193a29
--- /dev/null
@@ -0,0 +1,382 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<keyboard>
+
+<options>
+<!-- not yet implemented -->
+</options>
+
+<layout id="defualt keyboard">
+
+  <!-- <row>
+
+    <space width="500" extended="true"/>
+
+    <key fill="true">
+         <default display="Esc" action="escape" />
+    </key>
+
+    <key>
+         <default display="`" />
+    </key>
+    <key>
+         <default display="1" />                
+         <shifted display="!" />
+    </key>
+    <key>
+         <default display="2" />                
+         <shifted display='"' />
+          <mod1    display="½" />
+    </key>
+    <key>
+         <default display="3" />
+         <shifted display="£" />
+          <mod1    display="¾" />               
+    </key>
+    <key>
+         <default display="4" />
+         <shifted display="$" />                
+    </key>
+    <key>
+         <default display="5" />
+         <shifted display="%" />                
+    </key>
+    <key>
+         <default display="6" />
+         <shifted display="^" />                
+    </key>
+    <key>
+         <default display="7" />
+         <shifted display="&amp;" />                
+    </key>
+    <key>
+         <default display="8" />
+         <shifted display="*" />                
+    </key>
+    <key>
+         <default display="9" />
+         <shifted display="(" />                
+    </key>
+    <key>
+         <default display="0" />
+         <shifted display=")" />                
+    </key>
+    <key>
+         <default display="-" />
+         <shifted display="_" />                
+    </key>
+    <key>
+         <default display="=" />
+         <shifted display="+" />                
+    </key>
+
+    <key fill="true">
+         <default display="Bksp" action="backspace"/>
+    </key>
+
+    <space width="500" extended="true"/>
+
+    <key width="4000"  extended="true">
+         <default display="Home" action="home"/>
+    </key>
+    <key width="4000"  extended="true">
+         <default display="PgUp" action="pageup"/>
+    </key>
+
+    <space width="500" extended="true"/>
+
+
+  </row> -->
+
+  <row>
+
+    <space width="500" extended="true"/>
+
+    <key fill="true">
+         <!-- <default display="↹" action="tab"/> -->
+          <default display="Tab" action="tab"/>
+    </key>
+    <key obey-caps='true'>
+         <default display="q" />                
+         <shifted display="Q" />
+         <mod1 display="1" />
+    </key>
+    <key obey-caps='true'>
+         <default display="w" />                
+         <shifted display="W" />
+         <mod1 display="2" />
+    </key>
+    <key obey-caps='true'>
+         <mod1 display="ë" />
+         <default    display="e" />                
+         <shifted display="E" />
+         <mod1 display="3" />
+    </key>
+    <key obey-caps='true'>
+         <default display="r" />                
+         <shifted display="R" />
+         <mod1 display="4" />
+    </key>
+    <key obey-caps='true'>
+         <default display="t" />                
+         <shifted display="T" />
+         <mod1 display="5" />
+    </key>
+    <key obey-caps='true'>
+         <default display="y" />                
+         <shifted display="Y" />
+         <mod1 display="6" />
+    </key>
+    <key obey-caps='true'>
+         <default display="u" />                
+         <shifted display="U" />
+         <mod1 display="7" />
+    </key>
+    <key obey-caps='true'>
+         <default display="i" />                
+         <shifted display="I" />
+         <mod1 display="8" />
+    </key>
+    <key obey-caps='true'>
+         <default display="o" />                
+         <shifted display="O" />
+         <mod1 display="9" />
+    </key>
+    <key obey-caps='true'>
+         <default display="p" />                
+         <shifted display="P" />
+         <mod1 display="0" />
+    </key>
+    <!-- <key>
+         <default display="{" />                
+         <shifted display="[" />
+    </key>
+    <key>
+         <default display="}" />                
+         <shifted display="]" />
+    </key>
+    <key fill="true">
+         <default display="\" />                
+         <shifted display="|" />
+    </key> -->
+
+    <!-- <space width="500" extended="true"/>
+
+    <key width="4000"  extended="true">
+         <default display="End" action="end"/>
+    </key>
+    <key width="4000"  extended="true">
+         <default display="PgDn" action="pagedown"/>
+    </key> -->
+
+    <space width="500" extended="true"/>
+
+  </row>
+  <row>
+
+    <space width="500" extended="true"/>
+
+    <key fill="true" width="1750">
+         <default display="Caps" action="modifier:caps"/>                
+    </key>
+    <key obey-caps='true'>
+         <default display="a" />                
+         <shifted display="A" />
+         <mod1 display="-" />
+    </key>
+    <key obey-caps='true'>
+         <default display="s" />                
+         <shifted display="S" />
+         <mod1 display="+" />
+    </key>
+    <key obey-caps='true'>
+         <default display="d" />                
+         <shifted display="D" />
+         <mod1 display=":" />
+    </key>
+    <key obey-caps='true'>
+         <default display="f" />                
+         <shifted display="F" />
+         <mod1 display=";" />
+    </key>
+    <key obey-caps='true'>
+         <default display="g" />                
+         <shifted display="G" />
+         <mod1 display="(" />
+    </key>
+    <key obey-caps='true'>
+         <default display="h" />                
+         <shifted display="H" />
+         <mod1 display=")" />
+    </key>
+    <key obey-caps='true'>
+         <default display="j" />                
+         <shifted display="J" />
+         <mod1 display="$" />
+    </key>
+    <key obey-caps='true'>
+         <default display="k" />                
+         <shifted display="K" />
+         <mod1 display="&amp;" />
+    </key>
+    <key obey-caps='true'>
+         <default display="l" />                
+         <shifted display="L" />
+         <mod1 display="@" />
+    </key>
+    <!-- <key>
+         <default display=";" />                
+         <shifted display=":" />
+    </key>
+    <key>
+         <default display="#" />                
+         <shifted display="~" />
+    </key> -->
+    <key fill="true" width="1200">
+         <!-- <default display="◀┛" action="return"/> -->
+          <default display="Ret" action="return"/>
+         <mod1 display="*" />
+    </key>
+
+    <space width="500" extended="true"/>
+
+    <!-- <space width="4000"  extended="true" />
+
+    <space width="4000"  extended="true" />
+
+    <space width="500" extended="true"/> -->
+
+
+  </row>
+  <row>
+
+    <space width="500" extended="true"/>
+
+    <key fill="true" width="1600">
+         <default display="Shift" action="modifier:shift"/>                
+    </key>
+
+    <key obey-caps='true'>
+         <default display="z" />                
+         <shifted display="Z" />
+         <mod1 display="[" />
+    </key>
+
+    <key obey-caps='true'>
+         <default display="x" />                
+         <shifted display="X" />
+         <mod1 display="]" />
+    </key>
+
+    <key obey-caps='true'>
+         <default display="c" />                
+         <shifted display="C" />
+         <mod1 display="," />
+    </key>
+
+    <key obey-caps='true'>
+         <default display="v" />                
+         <shifted display="V" />
+         <mod1 display="|" />
+    </key>
+
+    <key obey-caps='true'>
+         <default display="b" />                
+         <shifted display="B" />
+         <mod1 display="!" />
+    </key>
+
+    <key obey-caps='true'>
+         <default display="n" />                
+         <shifted display="N" />
+         <mod1 display="=" />
+    </key>
+
+    <key obey-caps='true'>
+         <default display="m" />                
+         <shifted display="M" />
+         <mod1 display="&lt;" />
+    </key>
+
+    <!-- <key>
+         <default display="," />                
+         <shifted display="&lt;" />
+    </key>
+    <key>
+         <default display="." />                
+         <shifted display="&gt;" />
+    </key> -->
+    <key>
+         <default display="/" />                
+         <shifted display="?" />
+         <mod1 display="&gt;" />
+    </key>
+
+
+    <key fill="true" width="2000">
+         <default display="Bkspc" action="backspace"/>                
+    </key>
+
+    <space width="500" extended="true"/>
+
+    <!-- <space width="4000"  extended="true" />
+
+    <space width="4000"  extended="true" />
+
+    <space width="500" extended="true"/> -->
+
+
+
+ </row>
+  <row>
+
+    <space width="500" extended="true"/>
+
+    <key fill="true" width="1200">
+         <default display="123" action="modifier:mod1"/>                
+    </key>
+
+    <key fill="true" width="1200">
+         <default display="Ctl" action="modifier:ctrl"/>                
+    </key>
+
+    <key width="1200">
+         <default display="Alt" action="modifier:alt"/>                
+    </key>
+
+
+    <key width="3500">
+         <default display=" " action="space" />                
+    </key>
+
+    <key>
+         <default display="." />                
+         <shifted display="'" />
+    </key>
+
+    <key>
+         <default display="↑" action="up" />                
+    </key>
+    <key>
+         <default display="↓" action="down" />                
+    </key>
+    <key>
+         <default display="←" action="left" />                
+    </key>
+    <key>
+         <default display="→" action="right" />                
+    </key>
+
+    <space width="500" extended="true"/>
+
+    <!-- <space width="4000"  extended="true" />
+
+    <space width="4000"  extended="true" />
+
+    <space width="500" extended="true"/> -->
+
+</row>
+
+</layout>
+
+
+</keyboard>
diff --git a/recipes/matchbox-keyboard/files/mb_kb_mods.patch b/recipes/matchbox-keyboard/files/mb_kb_mods.patch
new file mode 100644 (file)
index 0000000..3377b84
--- /dev/null
@@ -0,0 +1,14 @@
+Index: matchbox-keyboard/src/matchbox-keyboard-key.c
+===================================================================
+--- matchbox-keyboard.orig/src/matchbox-keyboard-key.c 2007-10-20 14:07:47.000000000 -0400
++++ matchbox-keyboard/src/matchbox-keyboard-key.c      2008-08-26 11:18:33.000000000 -0400
+@@ -589,8 +589,7 @@
+       {
+         if (mb_kbd_has_any_state(kbd))
+           {
+-            mb_kbd_remove_state(kbd, (MBKeyboardStateShifted|
+-                                      MBKeyboardStateMod1|
++            mb_kbd_remove_state(kbd, (MBKeyboardStateShifted|         
+                                       MBKeyboardStateMod2|
+                                       MBKeyboardStateMod3|
+                                       MBKeyboardStateControl|
diff --git a/recipes/matchbox-keyboard/files/mb_kbd_size.patch b/recipes/matchbox-keyboard/files/mb_kbd_size.patch
new file mode 100644 (file)
index 0000000..5ecf1ad
--- /dev/null
@@ -0,0 +1,15 @@
+Index: matchbox-keyboard/src/matchbox-keyboard-ui.c
+===================================================================
+--- matchbox-keyboard.orig/src/matchbox-keyboard-ui.c  2008-02-07 08:14:02.000000000 -0500
++++ matchbox-keyboard/src/matchbox-keyboard-ui.c       2008-08-26 16:58:10.000000000 -0400
+@@ -860,8 +860,8 @@
+   MARK();
+   /* Don't scale beyond a sensible height on wide screens */
+-  if (height > (ui->dpy_height / 3))
+-    height = ui->dpy_height / 3;
++  if (height > (ui->dpy_height / 2))
++    height = ui->dpy_height / 2;
+   width_diff  = width  - ui->base_alloc_width; 
+   height_diff = height - ui->base_alloc_height; 
index f8822e7..516c8ee 100644 (file)
@@ -5,7 +5,7 @@ RCONFLICTS_${PN} = "matchbox-keyboard"
 SECTION = "x11"
 SRCREV = "1910"
 PV = "0.0+svnr${SRCPV}"
-PR = "r12"
+PR = "r13"
 
 SRC_URI = "svn://svn.o-hand.com/repos/matchbox/trunk;module=matchbox-keyboard;proto=http \
            file://smallscreen-fontsize.patch \
@@ -17,6 +17,10 @@ SRC_URI = "svn://svn.o-hand.com/repos/matchbox/trunk;module=matchbox-keyboard;pr
         file://7-Newer-autotools.patch \
            file://80matchboxkeyboard"
 
+SRC_URI_append_bug20 = " file://mb_kb_mods.patch \
+                       file://mb_kbd_size.patch \
+                       file://keyboard-bug.xml"
+
 SRC_URI_append_om-gta01 = " file://fic-gta01-font-size.patch"
 SRC_URI_append_om-gta02 = " file://fic-gta01-font-size.patch"
 
@@ -46,6 +50,13 @@ do_install_append () {
        install -m 755 ${WORKDIR}/80matchboxkeyboard ${D}/${sysconfdir}/X11/Xsession.d/
 }
 
+do_install_append_bug20 () {
+       install -d ${D}/${sysconfdir}/X11/Xsession.d/
+       install -m 755 ${WORKDIR}/80matchboxkeyboard ${D}/${sysconfdir}/X11/Xsession.d/
+       install -d ${D}/${datadir}/matchbox-keyboard/
+       install -m 644 ${WORKDIR}/keyboard-bug.xml ${D}/${datadir}/matchbox-keyboard/
+}
+
 pkg_postinst_matchbox-keyboard-im () {
 if [ "x$D" != "x" ]; then
   exit 1