summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-02-25 17:59:06 +0100
committerGerrit Code Review <gerrit2@gerrit>2014-02-25 17:59:06 +0100
commitababafef36a50bfef0cf4f6a96f16316f1945c17 (patch)
treec83a73cf45bc8a2f62589002fde9b6b31235c0f0
parentMerge "Look also for buttons when checking if input device is mouse" into android-4.4 (diff)
parentAdd capslock support to keyboard (diff)
downloadandroid_bootable_recovery-ababafef36a50bfef0cf4f6a96f16316f1945c17.tar
android_bootable_recovery-ababafef36a50bfef0cf4f6a96f16316f1945c17.tar.gz
android_bootable_recovery-ababafef36a50bfef0cf4f6a96f16316f1945c17.tar.bz2
android_bootable_recovery-ababafef36a50bfef0cf4f6a96f16316f1945c17.tar.lz
android_bootable_recovery-ababafef36a50bfef0cf4f6a96f16316f1945c17.tar.xz
android_bootable_recovery-ababafef36a50bfef0cf4f6a96f16316f1945c17.tar.zst
android_bootable_recovery-ababafef36a50bfef0cf4f6a96f16316f1945c17.zip
-rwxr-xr-xgui/devices/1024x600/res/ui.xml4
-rw-r--r--gui/devices/1024x768/res/ui.xml4
-rw-r--r--gui/devices/1080x1920/res/ui.xml4
-rw-r--r--gui/devices/1200x1920/res/ui.xml4
-rw-r--r--gui/devices/1280x800/res/ui.xml4
-rw-r--r--gui/devices/1920x1200/res/ui.xml4
-rw-r--r--gui/devices/2560x1600/res/ui.xml4
-rw-r--r--gui/devices/320x480/res/ui.xml4
-rw-r--r--gui/devices/480x800/res/ui.xml4
-rw-r--r--gui/devices/480x854/res/ui.xml4
-rw-r--r--gui/devices/540x960/res/ui.xml4
-rw-r--r--gui/devices/720x1280/res/ui.xml4
-rwxr-xr-xgui/devices/800x1280/res/ui.xml4
-rwxr-xr-xgui/devices/800x480/res/ui.xml4
-rw-r--r--gui/keyboard.cpp63
-rw-r--r--gui/objects.hpp10
16 files changed, 112 insertions, 17 deletions
diff --git a/gui/devices/1024x600/res/ui.xml b/gui/devices/1024x600/res/ui.xml
index 4597fb3a3..190e6f5d1 100755
--- a/gui/devices/1024x600/res/ui.xml
+++ b/gui/devices/1024x600/res/ui.xml
@@ -102,6 +102,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="slider_x" value="307" />
<variable name="slider_y" value="470" />
<variable name="slider_text_y" value="520" />
@@ -382,6 +383,7 @@
<placement x="0" y="341" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="65" width="92" />
<row1 key01="q" long01="1" key02="w" long02="2" key03="e" long03="3" key04="r" long04="4" key05="t" long05="5" key06="y" long06="6" key07="u" long07="7" key08="i" long08="8" key09="o" long09="9" key10="p" long10="0" key11="104:c:8" />
@@ -390,7 +392,7 @@
<row4 key01="132:layout3" key02="92:" key03="/" long03="@" key04="404: " key05="'" long05="92:c:34" key06="-" long06="_" />
</layout1>
<layout2>
- <keysize height="65" width="92" />
+ <keysize height="65" width="92" capslock="0" revert_layout="1" />
<row1 key01="Q" long01="1" key02="W" long02="2" key03="E" long03="3" key04="R" long04="4" key05="T" long05="5" key06="Y" long06="6" key07="U" long07="7" key08="I" long08="8" key09="O" long09="9" key10="P" long10="0" key11="104:c:8" />
<row2 key01="138:A" key02="S" key03="D" key04="F" key05="G" key06="H" key07="J" key08="K" key09="L" key10="150:action" />
<row3 key01="102:layout1" key02="91:Z" key03="91:X" key04="91:C" key05="91:V" key06="91:B" key07="91:N" key08="91:M" key09="91:," long09="!" key10="91:." long10="?" key11="103::" long11="+" />
diff --git a/gui/devices/1024x768/res/ui.xml b/gui/devices/1024x768/res/ui.xml
index 84f470298..434fe36d5 100644
--- a/gui/devices/1024x768/res/ui.xml
+++ b/gui/devices/1024x768/res/ui.xml
@@ -102,6 +102,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="slider_x" value="307" />
<variable name="slider_y" value="600" />
<variable name="slider_text_y" value="650" />
@@ -382,6 +383,7 @@
<placement x="0" y="408" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="90" width="85" />
<row1 key01="80:" key02="q" long02="1" key03="w" long03="2" key04="e" long04="3" key05="r" long05="4" key06="t" long06="5" key07="y" long07="6" key08="u" long08="7" key09="i" long09="8" key10="o" long10="9" key11="p" long11="0" key12="94:c:8" />
@@ -390,7 +392,7 @@
<row4 key01="320:" key02="385: " key03="80:/" long03=":" key04="80:-" long04="_" />
</layout1>
<layout2>
- <keysize height="90" width="85" />
+ <keysize height="90" width="85" capslock="0" revert_layout="1" />
<row1 key01="80:" key02="Q" long02="1" key03="W" long03="2" key04="E" long04="3" key05="R" long05="4" key06="T" long06="5" key07="Y" long07="6" key08="U" long08="7" key09="I" long09="8" key10="O" long10="9" key11="P" long11="0" key12="94:c:8" />
<row2 key01="115:layout3" key02="83:A" key03="83:S" key04="83:D" key05="83:F" key06="83:G" key07="83:H" key08="83:J" key09="83:K" key10="83:L" key11="162:action" />
<row3 key01="140:layout1" key02="82:Z" key03="82:X" key04="82:C" key05="82:V" key06="82:B" key07="82:N" key08="82:M" key09="82:," long09="!" key10="82:." long10="?" key11="144:layout1" />
diff --git a/gui/devices/1080x1920/res/ui.xml b/gui/devices/1080x1920/res/ui.xml
index 3ab69a6ed..c336dbade 100644
--- a/gui/devices/1080x1920/res/ui.xml
+++ b/gui/devices/1080x1920/res/ui.xml
@@ -101,6 +101,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="home_button_x" value="10" />
<variable name="home_button_y" value="1839" />
<variable name="back_button_x" value="944" />
@@ -368,6 +369,7 @@
<placement x="0" y="1200" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="161" width="108" />
<row1 key01="q" long01="1" key02="w" long02="2" key03="e" long03="3" key04="r" long04="4" key05="t" long05="5" key06="y" long06="6" key07="u" long07="7" key08="i" long08="8" key09="o" long09="9" key10="p" long10="0" />
@@ -376,7 +378,7 @@
<row4 key01="162:layout3" key02="108:c:47" key03="108:" key04="432: " key05="." key06="162:action" />
</layout1>
<layout2>
- <keysize height="161" width="108" />
+ <keysize height="161" width="108" capslock="0" revert_layout="1" />
<row1 key01="Q" long01="1" key02="W" long02="2" key03="E" long03="3" key04="R" long04="4" key05="T" long05="5" key06="Y" long06="6" key07="U" long07="7" key08="I" long08="8" key09="O" long09="9" key10="P" long10="0" />
<row2 key01="162:A" long01="@" key02="S" long02="#" key03="D" long03="$" key04="F" long04="%" key05="G" long05="&" key06="H" long06="*" key07="J" long07="-" key08="K" long08="+" key09="162:L" long09="_" />
<row3 key01="162:layout1" key02="Z" long02="!" key03="X" key04="C" long04="'" key05="V" long05=":" key06="B" long06=";" key07="N" long07="/" key08="M" long08="?" key09="162:c:8" />
diff --git a/gui/devices/1200x1920/res/ui.xml b/gui/devices/1200x1920/res/ui.xml
index 5aedca8b1..175121632 100644
--- a/gui/devices/1200x1920/res/ui.xml
+++ b/gui/devices/1200x1920/res/ui.xml
@@ -104,6 +104,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="home_button_x" value="10" />
<variable name="home_button_y" value="1839" />
<variable name="back_button_x" value="1064" />
@@ -371,6 +372,7 @@
<placement x="0" y="1129" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="179" width="120" />
<row1 key01="q" long01="1" key02="w" long02="2" key03="e" long03="3" key04="r" long04="4" key05="t" long05="5" key06="y" long06="6" key07="u" long07="7" key08="i" long08="8" key09="o" long09="9" key10="p" long10="0" />
@@ -379,7 +381,7 @@
<row4 key01="180:layout3" key02="120:c:47" key03="600: " key04="." key05="180:action" />
</layout1>
<layout2>
- <keysize height="179" width="120" />
+ <keysize height="179" width="120" capslock="0" revert_layout="1" />
<row1 key01="Q" long01="1" key02="W" long02="2" key03="E" long03="3" key04="R" long04="4" key05="T" long05="5" key06="Y" long06="6" key07="U" long07="7" key08="I" long08="8" key09="O" long09="9" key10="P" long10="0" />
<row2 key01="180:A" long01="@" key02="S" long02="#" key03="D" long03="$" key04="F" long04="%" key05="G" long05="&" key06="H" long06="*" key07="J" long07="-" key08="K" long08="+" key09="162:L" long09="_" />
<row3 key01="180:layout1" key02="Z" long02="!" key03="X" key04="C" long04="'" key05="V" long05=":" key06="B" long06=";" key07="N" long07="/" key08="M" long08="?" key09="180:c:8" />
diff --git a/gui/devices/1280x800/res/ui.xml b/gui/devices/1280x800/res/ui.xml
index c7d914893..447f760fa 100644
--- a/gui/devices/1280x800/res/ui.xml
+++ b/gui/devices/1280x800/res/ui.xml
@@ -102,6 +102,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="slider_x" value="435" />
<variable name="slider_y" value="600" />
<variable name="slider_text_y" value="650" />
@@ -382,6 +383,7 @@
<placement x="0" y="438" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="91" width="106" />
<row1 key01="102:" key02="q" long02="1" key03="w" long03="2" key04="e" long04="3" key05="r" long05="4" key06="t" long06="5" key07="y" long07="6" key08="u" long08="7" key09="i" long09="8" key10="o" long10="9" key11="p" long11="0" key12="118:c:8" />
@@ -390,7 +392,7 @@
<row4 key01="190:" key02=":" long02="+" key03="104:/" long03="@" key04="480: " key05="102:'" long05="102:c:34" key06="-" long06="_" />
</layout1>
<layout2>
- <keysize height="90" width="106" />
+ <keysize height="90" width="106" capslock="0" revert_layout="1" />
<row1 key01="102:" key02="Q" long02="1" key03="W" long03="2" key04="E" long04="3" key05="R" long05="4" key06="T" long06="5" key07="Y" long07="6" key08="U" long08="7" key09="I" long09="8" key10="O" long10="9" key11="P" long11="0" key12="118:c:8" />
<row2 key01="142:layout3" key02="104:A" key03="104:S" key04="104:D" key05="104:F" key06="104:G" key07="104:H" key08="104:J" key09="104:K" key10="104:L" key11="202:action" />
<row3 key01="176:layout1" key02="103:Z" key03="103:X" key04="103:C" key05="103:V" key06="103:B" key07="103:N" key08="103:M" key09="103:," long09="!" key10="103:." long10="?" key11="177:layout1" />
diff --git a/gui/devices/1920x1200/res/ui.xml b/gui/devices/1920x1200/res/ui.xml
index dbd6a0b2d..251c5fb6c 100644
--- a/gui/devices/1920x1200/res/ui.xml
+++ b/gui/devices/1920x1200/res/ui.xml
@@ -102,6 +102,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="slider_x" value="630" />
<variable name="slider_y" value="1000" />
<variable name="slider_text_y" value="1075" />
@@ -382,6 +383,7 @@
<placement x="0" y="684" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="129" width="159" />
<row1 key01="153:" key02="q" long02="1" key03="w" long03="2" key04="e" long04="3" key05="r" long05="4" key06="t" long06="5" key07="y" long07="6" key08="u" long08="7" key09="i" long09="8" key10="o" long10="9" key11="p" long11="0" key12="177:c:8" />
@@ -390,7 +392,7 @@
<row4 key01="600:" key02="720: " key03="/" long03=":" key04="-" long0="_" />
</layout1>
<layout2>
- <keysize height="129" width="159" />
+ <keysize height="129" width="159" capslock="0" revert_layout="1" />
<row1 key01="153:" key02="Q" long02="1" key03="W" long03="2" key04="E" long04="3" key05="R" long05="4" key06="T" long06="5" key07="Y" long07="6" key08="U" long08="7" key09="I" long09="8" key10="O" long10="9" key11="P" long11="0" key12="177:c:8" />
<row2 key01="213:layout3" key02="156:A" key03="156:S" key04="156:D" key05="156:F" key06="156:G" key07="156:H" key08="156:J" key09="156:K" key10="156:L" key11="303:action" />
<row3 key01="269:layout1" key02="154:Z" key03="154:X" key04="154:C" key05="154:V" key06="154:B" key07="154:N" key08="154:M" key09="154:," long09="!" key10="154:." long10="?" key11="265:layout1" />
diff --git a/gui/devices/2560x1600/res/ui.xml b/gui/devices/2560x1600/res/ui.xml
index 0a501afc0..5344de200 100644
--- a/gui/devices/2560x1600/res/ui.xml
+++ b/gui/devices/2560x1600/res/ui.xml
@@ -102,6 +102,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="slider_x" value="841" />
<variable name="slider_y" value="1335" />
<variable name="slider_text_y" value="1435" />
@@ -382,6 +383,7 @@
<placement x="0" y="912" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="172" width="212" />
<row1 key01="204:" key02="q" long02="1" key03="w" long03="2" key04="e" long04="3" key05="r" long05="4" key06="t" long06="5" key07="y" long07="6" key08="u" long08="7" key09="i" long09="8" key10="o" long10="9" key11="p" long11="0" key12="236:c:8" />
@@ -390,7 +392,7 @@
<row4 key01="560:" key02="206:/" long02="@" key03="1030: " key04="206:'" long04="206:c:34" key05="212:-" long05="212:_" />
</layout1>
<layout2>
- <keysize height="172" width="212" />
+ <keysize height="172" width="212" capslock="0" revert_layout="1" />
<row1 key01="204:" key02="Q" long02="1" key03="W" long03="2" key04="E" long04="3" key05="R" long05="4" key06="T" long06="5" key07="Y" long07="6" key08="U" long08="7" key09="I" long09="8" key10="O" long10="9" key11="P" long11="0" key12="236:c:8" />
<row2 key01="286:layout3" key02="208:A" key03="208:S" key04="208:D" key05="208:F" key06="208:G" key07="208:H" key08="208:J" key09="208:K" key10="208:L" key11="402:action" />
<row3 key01="354:layout1" key02="206:Z" key03="206:X" key04="206:C" key05="206:V" key06="206:B" key07="206:N" key08="206:M" key09="206:," long09="!" key10="206:." long10="?" key11="352:layout1" />
diff --git a/gui/devices/320x480/res/ui.xml b/gui/devices/320x480/res/ui.xml
index 3c3b73d26..5b6fa02bb 100644
--- a/gui/devices/320x480/res/ui.xml
+++ b/gui/devices/320x480/res/ui.xml
@@ -97,6 +97,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="home_button_x" value="7" />
<variable name="home_button_y" value="460" />
<variable name="back_button_x" value="275" />
@@ -355,6 +356,7 @@
<placement x="0" y="253" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="52" width="32" />
<row1 key01="q" long01="1" key02="w" long02="2" key03="e" long03="3" key04="r" long04="4" key05="t" long05="5" key06="y" long06="6" key07="u" long07="7" key08="i" long08="8" key09="o" long09="9" key10="p" long10="0" />
@@ -363,7 +365,7 @@
<row4 key01="48:layout3" key02="32:" key03="160: " key04="32:." key05="48:a:action" />
</layout1>
<layout2>
- <keysize height="52" width="32" />
+ <keysize height="52" width="32" capslock="0" revert_layout="1" />
<row1 key01="Q" long01="1" key02="W" long02="2" key03="E" long03="3" key04="R" long04="4" key05="T" long05="5" key06="Y" long06="6" key07="U" long07="7" key08="I" long08="8" key09="O" long09="9" key10="P" long10="0" />
<row2 key01="48:A" key02="S" key03="D" key04="F" key05="G" key06="H" key07="J" key08="K" key09="48:L" />
<row3 key01="48:layout1" key02="Z" key03="X" key04="C" key05="V" key06="B" key07="N" key08="M" key09="48:c:8" />
diff --git a/gui/devices/480x800/res/ui.xml b/gui/devices/480x800/res/ui.xml
index 32c90d936..be2db8f9b 100644
--- a/gui/devices/480x800/res/ui.xml
+++ b/gui/devices/480x800/res/ui.xml
@@ -97,6 +97,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="home_button_x" value="10" />
<variable name="home_button_y" value="766" />
<variable name="back_button_x" value="413" />
@@ -355,6 +356,7 @@
<placement x="0" y="450" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="78" width="48" />
<row1 key01="q" long01="1" key02="w" long02="2" key03="e" long03="3" key04="r" long04="4" key05="t" long05="5" key06="y" long06="6" key07="u" long07="7" key08="i" long08="8" key09="o" long09="9" key10="p" long10="0" />
@@ -363,7 +365,7 @@
<row4 key01="72:layout3" key02="48:" key03="240: " key04="48:." key05="72:a:action" />
</layout1>
<layout2>
- <keysize height="78" width="48" />
+ <keysize height="78" width="48" capslock="0" revert_layout="1" />
<row1 key01="Q" long01="1" key02="W" long02="2" key03="E" long03="3" key04="R" long04="4" key05="T" long05="5" key06="Y" long06="6" key07="U" long07="7" key08="I" long08="8" key09="O" long09="9" key10="P" long10="0" />
<row2 key01="72:A" key02="S" key03="D" key04="F" key05="G" key06="H" key07="J" key08="K" key09="72:L" />
<row3 key01="72:layout1" key02="Z" key03="X" key04="C" key05="V" key06="B" key07="N" key08="M" key09="72:c:8" />
diff --git a/gui/devices/480x854/res/ui.xml b/gui/devices/480x854/res/ui.xml
index a8357703c..42e6749ed 100644
--- a/gui/devices/480x854/res/ui.xml
+++ b/gui/devices/480x854/res/ui.xml
@@ -96,6 +96,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="home_button_x" value="10" />
<variable name="home_button_y" value="820" />
<variable name="back_button_x" value="413" />
@@ -354,6 +355,7 @@
<placement x="0" y="504" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="78" width="48" />
<row1 key01="q" long01="1" key02="w" long02="2" key03="e" long03="3" key04="r" long04="4" key05="t" long05="5" key06="y" long06="6" key07="u" long07="7" key08="i" long08="8" key09="o" long09="9" key10="p" long10="0" />
@@ -362,7 +364,7 @@
<row4 key01="72:layout3" key02="48:" key03="240: " key04="48:." key05="72:a:action" />
</layout1>
<layout2>
- <keysize height="78" width="48" />
+ <keysize height="78" width="48" capslock="0" revert_layout="1" />
<row1 key01="Q" long01="1" key02="W" long02="2" key03="E" long03="3" key04="R" long04="4" key05="T" long05="5" key06="Y" long06="6" key07="U" long07="7" key08="I" long08="8" key09="O" long09="9" key10="P" long10="0" />
<row2 key01="72:A" key02="S" key03="D" key04="F" key05="G" key06="H" key07="J" key08="K" key09="72:L" />
<row3 key01="72:layout1" key02="Z" key03="X" key04="C" key05="V" key06="B" key07="N" key08="M" key09="72:c:8" />
diff --git a/gui/devices/540x960/res/ui.xml b/gui/devices/540x960/res/ui.xml
index 0a43bebc2..a60fb3db0 100644
--- a/gui/devices/540x960/res/ui.xml
+++ b/gui/devices/540x960/res/ui.xml
@@ -97,6 +97,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="home_button_x" value="10" />
<variable name="home_button_y" value="919" />
<variable name="back_button_x" value="466" />
@@ -355,6 +356,7 @@
<placement x="0" y="600" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="78" width="54" />
<row1 key01="q" long01="1" key02="w" long02="2" key03="e" long03="3" key04="r" long04="4" key05="t" long05="5" key06="y" long06="6" key07="u" long07="7" key08="i" long08="8" key09="o" long09="9" key10="p" long10="0" />
@@ -363,7 +365,7 @@
<row4 key01="81:layout3" key02="54:/" key03="270: " key04="54:." key05="81:a:action" />
</layout1>
<layout2>
- <keysize height="78" width="54" />
+ <keysize height="78" width="54" capslock="0" revert_layout="1" />
<row1 key01="Q" long01="1" key02="W" long02="2" key03="E" long03="3" key04="R" long04="4" key05="T" long05="5" key06="Y" long06="6" key07="U" long07="7" key08="I" long08="8" key09="O" long09="9" key10="P" long10="0" />
<row2 key01="81:A" key02="S" key03="D" key04="F" key05="G" key06="H" key07="J" key08="K" key09="81:L" />
<row3 key01="81:layout1" key02="Z" key03="X" key04="C" key05="V" key06="B" key07="N" key08="M" key09="81:c:8" />
diff --git a/gui/devices/720x1280/res/ui.xml b/gui/devices/720x1280/res/ui.xml
index 37003da45..2cdd966c7 100644
--- a/gui/devices/720x1280/res/ui.xml
+++ b/gui/devices/720x1280/res/ui.xml
@@ -101,6 +101,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="home_button_x" value="10" />
<variable name="home_button_y" value="1226" />
<variable name="back_button_x" value="625" />
@@ -368,6 +369,7 @@
<placement x="0" y="800" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="106" width="72" />
<row1 key01="q" long01="1" key02="w" long02="2" key03="e" long03="3" key04="r" long04="4" key05="t" long05="5" key06="y" long06="6" key07="u" long07="7" key08="i" long08="8" key09="o" long09="9" key10="p" long10="0" />
@@ -376,7 +378,7 @@
<row4 key01="100:layout3" key02="130:" key03="260: " key04="65:." key05="165:a:action" />
</layout1>
<layout2>
- <keysize height="106" width="72" />
+ <keysize height="106" width="72" capslock="0" revert_layout="1" />
<row1 key01="Q" long01="1" key02="W" long02="2" key03="E" long03="3" key04="R" long04="4" key05="T" long05="5" key06="Y" long06="6" key07="U" long07="7" key08="I" long08="8" key09="O" long09="9" key10="P" long10="0" />
<row2 key01="108:A" key02="S" key03="D" key04="F" key05="G" key06="H" key07="J" key08="K" key09="108:L" />
<row3 key01="108:layout1" key02="Z" key03="X" key04="C" key05="V" key06="B" key07="N" key08="M" key09="108:c:8" />
diff --git a/gui/devices/800x1280/res/ui.xml b/gui/devices/800x1280/res/ui.xml
index 31006e6fa..fffe31cd8 100755
--- a/gui/devices/800x1280/res/ui.xml
+++ b/gui/devices/800x1280/res/ui.xml
@@ -97,6 +97,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="home_button_x" value="50" />
<variable name="home_button_y" value="1226" />
<variable name="back_button_x" value="666" />
@@ -356,6 +357,7 @@
<placement x="0" y="740" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="115" width="80" />
<row1 key01="q" long01="1" key02="w" long02="2" key03="e" long03="3" key04="r" long04="4" key05="t" long05="5" key06="y" long06="6" key07="u" long07="7" key08="i" long08="8" key09="o" long09="9" key10="p" long10="0" />
@@ -364,7 +366,7 @@
<row4 key01="117:layout3" key02="80:" key03="400: " key04="80:." key05="123:a:action" />
</layout1>
<layout2>
- <keysize height="116" width="80" />
+ <keysize height="116" width="80" capslock="0" revert_layout="1" />
<row1 key01="Q" long01="1" key02="W" long02="2" key03="E" long03="3" key04="R" long04="4" key05="T" long05="5" key06="Y" long06="6" key07="U" long07="7" key08="I" long08="8" key09="O" long09="9" key10="P" long10="0" />
<row2 key01="117:A" key02="S" key03="D" key04="F" key05="G" key06="H" key07="J" key08="K" key09="123:L" />
<row3 key01="117:layout1" key02="Z" key03="X" key04="C" key05="V" key06="B" key07="N" key08="M" key09="123:c:8" />
diff --git a/gui/devices/800x480/res/ui.xml b/gui/devices/800x480/res/ui.xml
index 8f881d779..35ca6e275 100755
--- a/gui/devices/800x480/res/ui.xml
+++ b/gui/devices/800x480/res/ui.xml
@@ -102,6 +102,7 @@
<variable name="text_success_color" value="#33B5E5" />
<variable name="text_fail_color" value="#FF0101" />
<variable name="highlight_color" value="#90909080" />
+ <variable name="caps_highlight_color" value="#33B5E580" />
<variable name="slider_x" value="225" />
<variable name="slider_y" value="390" />
<variable name="slider_text_y" value="425" />
@@ -390,6 +391,7 @@
<placement x="0" y="277" />
<layout resource1="keyboard1" resource2="keyboard2" resource3="keyboard3" resource4="keyboard4" />
<highlight color="%highlight_color%" />
+ <capshighlight color="%caps_highlight_color%" />
<layout1>
<keysize height="51" width="73" />
<row1 key01="q" long01="1" key02="w" long02="2" key03="e" long03="3" key04="r" long04="4" key05="t" long05="5" key06="y" long06="6" key07="u" long07="7" key08="i" long08="8" key09="o" long09="9" key10="p" long10="0" key11="70:c:8" />
@@ -398,7 +400,7 @@
<row4 key01="103:layout3" key02="72:" key03="/" long03="@" key04="315: " key05="'" long05="73:c:34" key06="-" long06="_" />
</layout1>
<layout2>
- <keysize height="51" width="73" />
+ <keysize height="51" width="73" capslock="0" revert_layout="1" />
<row1 key01="Q" long01="1" key02="W" long02="2" key03="E" long03="3" key04="R" long04="4" key05="T" long05="5" key06="Y" long06="6" key07="U" long07="7" key08="I" long08="8" key09="O" long09="9" key10="P" long10="0" key11="70:c:8" />
<row2 key01="107:A" key02="S" key03="D" key04="F" key05="G" key06="H" key07="J" key08="K" key09="L" key10="109:action" />
<row3 key01="79:layout1" key02="72:Z" key03="72:X" key04="72:C" key05="72:V" key06="72:B" key07="72:N" key08="72:M" key09="72:," long09="!" key10="72:." long10="?" key11="73::" long11="+" />
diff --git a/gui/keyboard.cpp b/gui/keyboard.cpp
index 78e27a164..bb52d55f9 100644
--- a/gui/keyboard.cpp
+++ b/gui/keyboard.cpp
@@ -47,7 +47,7 @@ GUIKeyboard::GUIKeyboard(xml_node<>* node)
{
int layoutindex, rowindex, keyindex, Xindex, Yindex, keyHeight = 0, keyWidth = 0;
rowY = colX = -1;
- highlightRenderCount = hasHighlight = 0;
+ highlightRenderCount = hasHighlight = hasCapsHighlight = 0;
char resource[10], layout[8], row[5], key[6], longpress[7];
xml_attribute<>* attr;
xml_node<>* child;
@@ -82,6 +82,17 @@ GUIKeyboard::GUIKeyboard(xml_node<>* node)
}
}
+ memset(&mCapsHighlightColor, 0, sizeof(COLOR));
+ child = node->first_node("capshighlight");
+ if (child) {
+ attr = child->first_attribute("color");
+ if (attr) {
+ hasCapsHighlight = 1;
+ std::string color = attr->value();
+ ConvertStrToColor(color, &mCapsHighlightColor);
+ }
+ }
+
// Load the images for the different layouts
child = node->first_node("layout");
if (child)
@@ -128,6 +139,16 @@ GUIKeyboard::GUIKeyboard(xml_node<>* node)
keyWidth = atoi(attr->value());
else
keyWidth = 0;
+ attr = child->first_attribute("capslock");
+ if (attr)
+ caps_tracking[layoutindex - 1].capslock = atoi(attr->value());
+ else
+ caps_tracking[layoutindex - 1].capslock = 1;
+ attr = child->first_attribute("revert_layout");
+ if (attr)
+ caps_tracking[layoutindex - 1].revert_layout = atoi(attr->value());
+ else
+ caps_tracking[layoutindex - 1].revert_layout = -1;
}
rowindex = 1;
@@ -320,6 +341,30 @@ int GUIKeyboard::Render(void)
if (keyboardImg[currentLayout - 1] && keyboardImg[currentLayout - 1]->GetResource())
gr_blit(keyboardImg[currentLayout - 1]->GetResource(), 0, 0, KeyboardWidth, KeyboardHeight, mRenderX, mRenderY);
+ // Draw highlight for capslock
+ if (hasCapsHighlight && caps_tracking[currentLayout - 1].capslock == 0 && caps_tracking[currentLayout - 1].set_capslock) {
+ int boxheight, boxwidth, x;
+ gr_color(mCapsHighlightColor.red, mCapsHighlightColor.green, mCapsHighlightColor.blue, mCapsHighlightColor.alpha);
+ for (int indexy=0; indexy<MAX_KEYBOARD_ROWS; indexy++) {
+ for (int indexx=0; indexx<MAX_KEYBOARD_KEYS; indexx++) {
+ if ((int)keyboard_keys[currentLayout - 1][indexy][indexx].key == KEYBOARD_LAYOUT && (int)keyboard_keys[currentLayout - 1][indexy][indexx].layout == caps_tracking[currentLayout - 1].revert_layout) {
+ if (indexy == 0)
+ boxheight = row_heights[currentLayout - 1][indexy];
+ else
+ boxheight = row_heights[currentLayout - 1][indexy] - row_heights[currentLayout - 1][indexy - 1];
+ if (indexx == 0) {
+ x = mRenderX;
+ boxwidth = keyboard_keys[currentLayout - 1][indexy][indexx].end_x;
+ } else {
+ x = mRenderX + keyboard_keys[currentLayout - 1][indexy][indexx - 1].end_x;
+ boxwidth = keyboard_keys[currentLayout - 1][indexy][indexx].end_x - keyboard_keys[currentLayout - 1][indexy][indexx - 1].end_x;
+ }
+ gr_fill(x, mRenderY + row_heights[currentLayout - 1][indexy - 1], boxwidth, boxheight);
+ }
+ }
+ }
+ }
+
if (hasHighlight && highlightRenderCount != 0) {
int boxheight, boxwidth, x;
if (rowY == 0)
@@ -477,9 +522,23 @@ int GUIKeyboard::NotifyTouch(TOUCH_STATE state, int x, int y)
if ((int)keyboard_keys[currentLayout - 1][rowIndex][indexx].key < KEYBOARD_SPECIAL_KEYS && (int)keyboard_keys[currentLayout - 1][rowIndex][indexx].key > 0) {
// Regular key
PageManager::NotifyKeyboard(keyboard_keys[currentLayout - 1][rowIndex][indexx].key);
+ if (caps_tracking[currentLayout - 1].capslock == 0 && !caps_tracking[currentLayout - 1].set_capslock) {
+ // caps lock was not set, change layouts
+ currentLayout = caps_tracking[currentLayout - 1].revert_layout;
+ mRendered = false;
+ }
} else if ((int)keyboard_keys[currentLayout - 1][rowIndex][indexx].key == KEYBOARD_LAYOUT) {
// Switch layouts
- currentLayout = keyboard_keys[currentLayout - 1][rowIndex][indexx].layout;
+ if (caps_tracking[currentLayout - 1].capslock == 0 && keyboard_keys[currentLayout - 1][rowIndex][indexx].layout == caps_tracking[currentLayout - 1].revert_layout) {
+ if (!caps_tracking[currentLayout - 1].set_capslock) {
+ caps_tracking[currentLayout - 1].set_capslock = 1; // Set the caps lock
+ } else {
+ caps_tracking[currentLayout - 1].set_capslock = 0; // Unset the caps lock and change layouts
+ currentLayout = keyboard_keys[currentLayout - 1][rowIndex][indexx].layout;
+ }
+ } else {
+ currentLayout = keyboard_keys[currentLayout - 1][rowIndex][indexx].layout;
+ }
mRendered = false;
} else if ((int)keyboard_keys[currentLayout - 1][rowIndex][indexx].key == KEYBOARD_ACTION) {
// Action
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 472d23b42..f8a4e8ca8 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -828,18 +828,26 @@ protected:
unsigned int end_x;
unsigned int layout;
};
+ struct capslock_tracking_struct
+ {
+ int capslock;
+ int set_capslock;
+ int revert_layout;
+ };
Resource* keyboardImg[MAX_KEYBOARD_LAYOUTS];
struct keyboard_key_class keyboard_keys[MAX_KEYBOARD_LAYOUTS][MAX_KEYBOARD_ROWS][MAX_KEYBOARD_KEYS];
+ struct capslock_tracking_struct caps_tracking[MAX_KEYBOARD_LAYOUTS];
bool mRendered;
std::string mVariable;
unsigned int cursorLocation;
unsigned int currentLayout;
unsigned int row_heights[MAX_KEYBOARD_LAYOUTS][MAX_KEYBOARD_ROWS];
unsigned int KeyboardWidth, KeyboardHeight;
- int rowY, colX, highlightRenderCount, hasHighlight;
+ int rowY, colX, highlightRenderCount, hasHighlight, hasCapsHighlight;
GUIAction* mAction;
COLOR mHighlightColor;
+ COLOR mCapsHighlightColor;
};
// GUIInput - Used for keyboard input