aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch
diff options
context:
space:
mode:
authorRoy <roy.mail.net@gmail.com>2018-05-22 22:50:06 +0300
committerRoy <roy.mail.net@gmail.com>2018-05-22 22:50:06 +0300
commit6faef62d683a670aa85ca4a4ff0c39cf1b3002ed (patch)
treea5d9fd09dcfdd916d99e2e3687420ea9610452e9 /Software/Visual_Studio/Tango.Touch
parentd719d039f355e207245b083f7db76703700c6c79 (diff)
downloadTango-6faef62d683a670aa85ca4a4ff0c39cf1b3002ed.tar.gz
Tango-6faef62d683a670aa85ca4a4ff0c39cf1b3002ed.zip
Started working on Tango.Touch project
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/CapsLockMode.cs15
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyDefinition.cs15
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardActionKeyMode.cs15
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardDefinition.cs448
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardModeToVisibilityConverter.cs25
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardModeToVisibilityInverseConverter.cs25
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs186
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml53
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeysLineDefinition.cs25
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyDefinition.cs21
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyDefinitionToWidthConverter.cs27
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyType.cs14
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs465
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.xaml451
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboardMode.cs16
-rw-r--r--Software/Visual_Studio/Tango.Touch/Properties/AssemblyInfo.cs17
-rw-r--r--Software/Visual_Studio/Tango.Touch/Properties/Resources.Designer.cs62
-rw-r--r--Software/Visual_Studio/Tango.Touch/Properties/Resources.resx117
-rw-r--r--Software/Visual_Studio/Tango.Touch/Properties/Settings.Designer.cs30
-rw-r--r--Software/Visual_Studio/Tango.Touch/Properties/Settings.settings7
-rw-r--r--Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj123
-rw-r--r--Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml11
-rw-r--r--Software/Visual_Studio/Tango.Touch/app.config47
-rw-r--r--Software/Visual_Studio/Tango.Touch/packages.config5
24 files changed, 2220 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/CapsLockMode.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/CapsLockMode.cs
new file mode 100644
index 000000000..633899aa8
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/CapsLockMode.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Touch.Keyboard
+{
+ public enum CapsLockMode
+ {
+ None,
+ SingleChar,
+ Locked
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyDefinition.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyDefinition.cs
new file mode 100644
index 000000000..270645743
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyDefinition.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Touch.Keyboard
+{
+ public class KeyDefinition
+ {
+ public String StandardText { get; set; }
+ public String CapsText { get; set; }
+ public String HoldText { get; set; }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardActionKeyMode.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardActionKeyMode.cs
new file mode 100644
index 000000000..fb574e476
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardActionKeyMode.cs
@@ -0,0 +1,15 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Touch.Keyboard
+{
+ public enum KeyboardActionKeyMode
+ {
+ Tab,
+ Enter,
+ Search,
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardDefinition.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardDefinition.cs
new file mode 100644
index 000000000..1486b6717
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardDefinition.cs
@@ -0,0 +1,448 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Input;
+
+namespace Tango.Touch.Keyboard
+{
+ public class KeyboardDefinition
+ {
+ public String Name { get; set; }
+
+ public String LanguageCode { get; set; }
+
+ public String EnterText { get; set; }
+
+ public String TabText { get; set; }
+
+ public List<KeysLineDefinition> KeysLinesDefinitions { get; set; }
+
+ public KeyboardDefinition()
+ {
+ KeysLinesDefinitions = new List<KeysLineDefinition>();
+ }
+
+ private static KeyboardDefinition _default;
+
+ public static KeyboardDefinition Default
+ {
+ get
+ {
+ if (_default == null)
+ {
+ _default = CreateDefaultAlphaNumeric();
+ }
+
+ return _default;
+ }
+ set { _default = value; }
+ }
+
+ internal static KeyboardDefinition CreateDefaultHebrewAlphaNumeric()
+ {
+ KeyboardDefinition definition = new KeyboardDefinition();
+
+ definition.Name = "Hebrew";
+ definition.LanguageCode = "HE";
+ definition.EnterText = "בצע";
+ definition.TabText = "הבא";
+
+ KeysLineDefinition line1 = new KeysLineDefinition();
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = ",",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = ".",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ק",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ר",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "א",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ט",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ו",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ן",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ם",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "פ",
+ });
+
+ KeysLineDefinition line2 = new KeysLineDefinition();
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ש",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ד",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ג",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "כ",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ע",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "י",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ח",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ל",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ך",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ף",
+ });
+
+ KeysLineDefinition line3 = new KeysLineDefinition();
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ז",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ס",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ב",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ה",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "נ",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "מ",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "צ",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ת",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "ץ",
+ });
+
+ line3.SpecialRightKeyDefinitions.Add(new SpecialKeyDefinition()
+ {
+ Type = SpecialKeyType.StandardText,
+ VectorMarkup = "M561 76.5H178.5c-17.85 0-30.6 7.65-40.8 22.95L0 306l137.7 206.55c10.2 12.75 22.95 22.95 40.8 22.95H561 c28.05 0 51-22.95 51-51v-357C612 99.45 589.05 76.5 561 76.5z M484.5 397.8l-35.7 35.7L357 341.7l-91.8 91.8l-35.7-35.7 l91.8-91.8l-91.8-91.8l35.7-35.7l91.8 91.8l91.8-91.8l35.7 35.7L392.7 306L484.5 397.8z",
+ Output = "{BACKSPACE}",
+ });
+
+ definition.KeysLinesDefinitions.Add(line1);
+ definition.KeysLinesDefinitions.Add(line2);
+ definition.KeysLinesDefinitions.Add(line3);
+
+ return definition;
+ }
+
+ private static KeyboardDefinition CreateDefaultAlphaNumeric()
+ {
+ KeyboardDefinition definition = new KeyboardDefinition();
+
+ definition.Name = "English";
+ definition.LanguageCode = "EN";
+ definition.EnterText = "GO";
+ definition.TabText = "NEXT";
+
+ KeysLineDefinition line1 = new KeysLineDefinition();
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "q",
+ CapsText = "Q",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "w",
+ CapsText = "W",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "e",
+ CapsText = "E",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "r",
+ CapsText = "R",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "t",
+ CapsText = "T",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "y",
+ CapsText = "Y",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "u",
+ CapsText = "U",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "i",
+ CapsText = "I",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "o",
+ CapsText = "O",
+ });
+
+ line1.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "p",
+ CapsText = "P",
+ });
+
+ KeysLineDefinition line2 = new KeysLineDefinition();
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "a",
+ CapsText = "A",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "s",
+ CapsText = "S",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "d",
+ CapsText = "D",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "f",
+ CapsText = "F",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "g",
+ CapsText = "G",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "h",
+ CapsText = "H",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "j",
+ CapsText = "J",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "k",
+ CapsText = "K",
+ });
+
+ line2.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "l",
+ CapsText = "L",
+ });
+
+ KeysLineDefinition line3 = new KeysLineDefinition();
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "z",
+ CapsText = "Z",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "x",
+ CapsText = "X",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "c",
+ CapsText = "C",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "v",
+ CapsText = "V",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "b",
+ CapsText = "B",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "n",
+ CapsText = "N",
+ });
+
+ line3.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "m",
+ CapsText = "M",
+ });
+
+ line3.SpecialLeftKeyDefinitions.Add(new SpecialKeyDefinition()
+ {
+ VectorMarkup = "M235.252 13.406l-0.447-0.998c-3.417-7.622-11.603-12.854-19.677-12.375l-0.3 0.016l-0.302-0.016 C214.194 0.011 213.856 0 213.524 0c-7.706 0-15.386 5.104-18.674 12.413l-0.452 0.998L13.662 176.079 c-6.871 6.183-6.495 12.657-4.971 16.999c2.661 7.559 10.361 13.373 18.313 13.82l1.592 0.297c0.68 0.168 1.356 0.348 2.095 0.427 c23.036 2.381 45.519 2.876 64.472 3.042l5.154 0.048V407.93c0 11.023 7.221 15.152 11.522 16.635l0.967 0.33l0.77 0.671 c3.105 2.717 7.02 4.093 11.644 4.093h179.215c4.626 0 8.541-1.376 11.639-4.093l0.771-0.671l0.965-0.33 c4.307-1.482 11.532-5.611 11.532-16.635V210.706l5.149-0.048c18.961-0.17 41.446-0.666 64.475-3.042 c0.731-0.079 1.407-0.254 2.082-0.422l1.604-0.302c7.952-0.447 15.65-6.262 18.312-13.82c1.528-4.336 1.899-10.811-4.972-16.998 L235.252 13.406z M344.114 173.365c-11.105 0.18-22.216 0.254-33.337 0.254c-5.153 0-9.363 1.607-12.507 4.768 c-3.372 3.4-5.296 8.48-5.266 13.932l0.005 0.65l-0.157 0.629c-0.437 1.767-0.64 3.336-0.64 4.928v194.001H137.458V198.526 c0-1.597-0.201-3.161-0.638-4.928l-0.157-0.629l0.005-0.65c0.031-5.456-1.892-10.537-5.271-13.937 c-3.141-3.161-7.353-4.763-12.507-4.768c-11.124 0-22.224-0.074-33.337-0.254l-13.223-0.218L214.834 44.897l142.503 128.249 L344.114 173.365z",
+ Output = "{CAPSLOCK}",
+ Type = SpecialKeyType.CapsLock,
+ });
+
+ line3.SpecialRightKeyDefinitions.Add(new SpecialKeyDefinition()
+ {
+ Type = SpecialKeyType.StandardText,
+ VectorMarkup = "M561 76.5H178.5c-17.85 0-30.6 7.65-40.8 22.95L0 306l137.7 206.55c10.2 12.75 22.95 22.95 40.8 22.95H561 c28.05 0 51-22.95 51-51v-357C612 99.45 589.05 76.5 561 76.5z M484.5 397.8l-35.7 35.7L357 341.7l-91.8 91.8l-35.7-35.7 l91.8-91.8l-91.8-91.8l35.7-35.7l91.8 91.8l91.8-91.8l35.7 35.7L392.7 306L484.5 397.8z",
+ Output = "{BACKSPACE}",
+ ColumnSpan = 2,
+ });
+
+ definition.KeysLinesDefinitions.Add(line1);
+ definition.KeysLinesDefinitions.Add(line2);
+ definition.KeysLinesDefinitions.Add(line3);
+
+ return definition;
+ }
+
+ internal static List<KeysLineDefinition> CreateDefaultSpecialCharacters()
+ {
+ KeysLineDefinition line1 = CreateLine("+", "x", "÷", "=", "%", "/", "\\", "$", "€", "£");
+ KeysLineDefinition line2 = CreateLine("@", "*", "!", "#", ":", ";", "&", "_", "(", ")");
+ KeysLineDefinition line3 = CreateLine("-", "'", "\"", ",", ".", "?");
+
+ line3.SpecialRightKeyDefinitions.Add(new SpecialKeyDefinition()
+ {
+ Type = SpecialKeyType.StandardText,
+ VectorMarkup = "M561 76.5H178.5c-17.85 0-30.6 7.65-40.8 22.95L0 306l137.7 206.55c10.2 12.75 22.95 22.95 40.8 22.95H561 c28.05 0 51-22.95 51-51v-357C612 99.45 589.05 76.5 561 76.5z M484.5 397.8l-35.7 35.7L357 341.7l-91.8 91.8l-35.7-35.7 l91.8-91.8l-91.8-91.8l35.7-35.7l91.8 91.8l91.8-91.8l35.7 35.7L392.7 306L484.5 397.8z",
+ Output = "{BACKSPACE}",
+ ColumnSpan = 2,
+ });
+
+ return new List<KeysLineDefinition>()
+ {
+ line1,
+ line2,
+ line3
+ };
+ }
+
+ private static KeysLineDefinition CreateLine(params String[] chars)
+ {
+ KeysLineDefinition line = new KeysLineDefinition();
+
+ foreach (var c in chars)
+ {
+ line.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = c,
+ });
+ }
+
+ return line;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardModeToVisibilityConverter.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardModeToVisibilityConverter.cs
new file mode 100644
index 000000000..bda8e5568
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardModeToVisibilityConverter.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Tango.Touch.Keyboard
+{
+ public class KeyboardModeToVisibilityConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if ((TouchKeyboardMode)value == (TouchKeyboardMode)parameter) return Visibility.Visible;
+ return Visibility.Collapsed;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardModeToVisibilityInverseConverter.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardModeToVisibilityInverseConverter.cs
new file mode 100644
index 000000000..41035d329
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardModeToVisibilityInverseConverter.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Tango.Touch.Keyboard
+{
+ public class KeyboardModeToVisibilityInverseConverter : IValueConverter
+ {
+ public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ if ((TouchKeyboardMode)value == (TouchKeyboardMode)parameter) return Visibility.Collapsed;
+ return Visibility.Visible;
+ }
+
+ public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs
new file mode 100644
index 000000000..36bdaced1
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs
@@ -0,0 +1,186 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Markup;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace Tango.Touch.Keyboard
+{
+ /// <summary>
+ /// Interaction logic for KeyboardView.xaml
+ /// </summary>
+ [ContentProperty(nameof(View))]
+ public partial class KeyboardView : Control
+ {
+ private static KeyboardView _instance;
+
+ private TouchKeyboard keyboard;
+
+ #region Properties
+
+ public bool IsOpened
+ {
+ get { return (bool)GetValue(IsOpenedProperty); }
+ set { SetValue(IsOpenedProperty, value); }
+ }
+ public static readonly DependencyProperty IsOpenedProperty =
+ DependencyProperty.Register("IsOpened", typeof(bool), typeof(KeyboardView), new PropertyMetadata(false));
+
+ public FrameworkElement View
+ {
+ get { return (FrameworkElement)GetValue(ViewProperty); }
+ set { SetValue(ViewProperty, value); }
+ }
+ public static readonly DependencyProperty ViewProperty =
+ DependencyProperty.Register("View", typeof(FrameworkElement), typeof(KeyboardView), new PropertyMetadata(null));
+
+ #endregion
+
+ #region Attached Properties
+
+ #region Mode
+
+ public static readonly DependencyProperty ModeProperty =
+ DependencyProperty.RegisterAttached("Mode",
+ typeof(TouchKeyboardMode?), typeof(KeyboardView),
+ new FrameworkPropertyMetadata(null, ModeChanged));
+
+ /// <summary>
+ /// Mode changed.
+ /// </summary>
+ /// <param name="d">The d.</param>
+ /// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
+ private static void ModeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ RegisterElement(d as FrameworkElement);
+ }
+
+ /// <summary>
+ /// Sets the Mode attached property.
+ /// </summary>
+ /// <param name="element">The element.</param>
+ /// <param name="value">if set to <c>true</c> [value].</param>
+ public static void SetMode(FrameworkElement element, TouchKeyboardMode? value)
+ {
+ element.SetValue(ModeProperty, value);
+ }
+
+ /// <summary>
+ /// Gets the Mode attached property.
+ /// </summary>
+ /// <param name="element">The element.</param>
+ /// <returns></returns>
+ public static TouchKeyboardMode? GetMode(FrameworkElement element)
+ {
+ return (TouchKeyboardMode?)element.GetValue(ModeProperty);
+ }
+
+ private static void RegisterElement(FrameworkElement element)
+ {
+ element.PreviewMouseUp += (_, __) => OnElementFocused(element);
+ element.PreviewTouchUp += (_, __) => OnElementFocused(element);
+ element.GotFocus += (_, __) => OnElementFocused(element);
+ element.LostFocus += (_, __) => OnElementLostFocus(element);
+ }
+
+ private async static void OnElementFocused(FrameworkElement element)
+ {
+ _instance.keyboard.ActionKeyMode = GetAction(element);
+ _instance.keyboard.Mode = GetMode(element).Value;
+ _instance.IsOpened = true;
+ await Task.Delay(200);
+ element.BringIntoView();
+ }
+
+ private static void OnElementLostFocus(FrameworkElement element)
+ {
+ _instance.IsOpened = false;
+ }
+
+ #endregion
+
+ #region Action
+
+ public static readonly DependencyProperty ActionProperty =
+ DependencyProperty.RegisterAttached("Action",
+ typeof(KeyboardActionKeyMode), typeof(KeyboardView),
+ new FrameworkPropertyMetadata(KeyboardActionKeyMode.Tab, ActionChanged));
+
+ /// <summary>
+ /// Action changed.
+ /// </summary>
+ /// <param name="d">The d.</param>
+ /// <param name="e">The <see cref="DependencyPropertyChangedEventArgs"/> instance containing the event data.</param>
+ private static void ActionChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
+ {
+ RegisterElement(d as FrameworkElement);
+ }
+
+ /// <summary>
+ /// Sets the Action attached property.
+ /// </summary>
+ /// <param name="element">The element.</param>
+ /// <param name="value">if set to <c>true</c> [value].</param>
+ public static void SetAction(FrameworkElement element, KeyboardActionKeyMode value)
+ {
+ element.SetValue(ActionProperty, value);
+ }
+
+ /// <summary>
+ /// Gets the Action attached property.
+ /// </summary>
+ /// <param name="element">The element.</param>
+ /// <returns></returns>
+ public static KeyboardActionKeyMode GetAction(FrameworkElement element)
+ {
+ return (KeyboardActionKeyMode)element.GetValue(ActionProperty);
+ }
+
+ #endregion
+
+ #endregion
+
+ #region Constructors
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="KeyboardView"/> class.
+ /// </summary>
+ public KeyboardView()
+ {
+ _instance = this;
+ }
+
+ #endregion
+
+ public override void OnApplyTemplate()
+ {
+ base.OnApplyTemplate();
+
+ keyboard = GetTemplateChild("PART_Keyboard") as TouchKeyboard;
+ keyboard.ActionKeyPressed += OnActionKeyPressed;
+ }
+
+ private void OnActionKeyPressed(object sender, KeyboardActionKeyMode mode)
+ {
+ if (mode == KeyboardActionKeyMode.Enter || mode == KeyboardActionKeyMode.Search)
+ {
+ IsOpened = false;
+ }
+ }
+
+ static KeyboardView()
+ {
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(KeyboardView), new FrameworkPropertyMetadata(typeof(KeyboardView)));
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml
new file mode 100644
index 000000000..db5ba6f3d
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml
@@ -0,0 +1,53 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="clr-namespace:Tango.Touch.Keyboard">
+
+
+ <Style TargetType="{x:Type local:KeyboardView}">
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type local:KeyboardView}">
+ <Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType=local:KeyboardView}}">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="1*"/>
+ <RowDefinition Height="Auto">
+ <RowDefinition.Style>
+ <Style TargetType="RowDefinition">
+ <Setter Property="MaxHeight" Value="0"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsOpened}" Value="True">
+ <DataTrigger.EnterActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetProperty="MaxHeight" To="1000" Duration="00:00:0.2"></DoubleAnimation>
+ </Storyboard>
+ </BeginStoryboard>
+ </DataTrigger.EnterActions>
+ <DataTrigger.ExitActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetProperty="MaxHeight" To="0" Duration="00:00:0.1"></DoubleAnimation>
+ </Storyboard>
+ </BeginStoryboard>
+ </DataTrigger.ExitActions>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </RowDefinition.Style>
+ </RowDefinition>
+ </Grid.RowDefinitions>
+
+ <Grid>
+ <ContentPresenter Content="{Binding View}"></ContentPresenter>
+ </Grid>
+
+ <Grid Grid.Row="1">
+ <local:TouchKeyboard x:Name="PART_Keyboard" />
+ </Grid>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeysLineDefinition.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeysLineDefinition.cs
new file mode 100644
index 000000000..4b5a32b2a
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeysLineDefinition.cs
@@ -0,0 +1,25 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace Tango.Touch.Keyboard
+{
+ public class KeysLineDefinition
+ {
+ public List<KeyDefinition> KeyDefinitions { get; set; }
+
+ public List<SpecialKeyDefinition> SpecialLeftKeyDefinitions { get; set; }
+
+ public List<SpecialKeyDefinition> SpecialRightKeyDefinitions { get; set; }
+
+ public KeysLineDefinition()
+ {
+ KeyDefinitions = new List<KeyDefinition>();
+ SpecialLeftKeyDefinitions = new List<SpecialKeyDefinition>();
+ SpecialRightKeyDefinitions = new List<SpecialKeyDefinition>();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyDefinition.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyDefinition.cs
new file mode 100644
index 000000000..eeba9aa45
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyDefinition.cs
@@ -0,0 +1,21 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Touch.Keyboard
+{
+ public class SpecialKeyDefinition
+ {
+ public SpecialKeyType Type { get; set; }
+ public String VectorMarkup { get; set; }
+ public int ColumnSpan { get; set; }
+ public String Output { get; set; }
+
+ public SpecialKeyDefinition()
+ {
+ ColumnSpan = 1;
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyDefinitionToWidthConverter.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyDefinitionToWidthConverter.cs
new file mode 100644
index 000000000..a22203214
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyDefinitionToWidthConverter.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Globalization;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Data;
+
+namespace Tango.Touch.Keyboard
+{
+ public class SpecialKeyDefinitionToWidthConverter : IMultiValueConverter
+ {
+ public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
+ {
+ Size size = (Size)values[0];
+ int columnSpan = (int)values[1];
+
+ return size.Width * (double)columnSpan;
+ }
+
+ public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyType.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyType.cs
new file mode 100644
index 000000000..4fdbdc710
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/SpecialKeyType.cs
@@ -0,0 +1,14 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Touch.Keyboard
+{
+ public enum SpecialKeyType
+ {
+ StandardText,
+ CapsLock,
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
new file mode 100644
index 000000000..d92fe4bb8
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
@@ -0,0 +1,465 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using Forms = System.Windows.Forms;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using Tango.Core.Commands;
+using System.Threading;
+using System.Collections.ObjectModel;
+
+namespace Tango.Touch.Keyboard
+{
+ /// <summary>
+ /// Follow steps 1a or 1b and then 2 to use this custom control in a XAML file.
+ ///
+ /// Step 1a) Using this custom control in a XAML file that exists in the current project.
+ /// Add this XmlNamespace attribute to the root element of the markup file where it is
+ /// to be used:
+ ///
+ /// xmlns:MyNamespace="clr-namespace:Tango.Touch.Keyboard"
+ ///
+ ///
+ /// Step 1b) Using this custom control in a XAML file that exists in a different project.
+ /// Add this XmlNamespace attribute to the root element of the markup file where it is
+ /// to be used:
+ ///
+ /// xmlns:MyNamespace="clr-namespace:Tango.Touch.Keyboard;assembly=Tango.Touch.Keyboard"
+ ///
+ /// You will also need to add a project reference from the project where the XAML file lives
+ /// to this project and Rebuild to avoid compilation errors:
+ ///
+ /// Right click on the target project in the Solution Explorer and
+ /// "Add Reference"->"Projects"->[Browse to and select this project]
+ ///
+ ///
+ /// Step 2)
+ /// Go ahead and use your control in the XAML file.
+ ///
+ /// <MyNamespace:TouchKeyboard/>
+ ///
+ /// </summary>
+ public class TouchKeyboard : Control
+ {
+ static TouchKeyboard()
+ {
+ DefaultStyleKeyProperty.OverrideMetadata(typeof(TouchKeyboard), new FrameworkPropertyMetadata(typeof(TouchKeyboard)));
+ }
+
+ private bool _isInitialized;
+
+ public event EventHandler<KeyboardActionKeyMode> ActionKeyPressed;
+
+ public bool IsSpecialCharactersOn
+ {
+ get { return (bool)GetValue(IsSpecialCharactersOnProperty); }
+ set { SetValue(IsSpecialCharactersOnProperty, value); }
+ }
+ public static readonly DependencyProperty IsSpecialCharactersOnProperty =
+ DependencyProperty.Register("IsSpecialCharactersOn", typeof(bool), typeof(TouchKeyboard), new PropertyMetadata(false, (d, e) => (d as TouchKeyboard).OnSpecialCharactersOnChanged()));
+
+ public TouchKeyboardMode Mode
+ {
+ get { return (TouchKeyboardMode)GetValue(ModeProperty); }
+ set { SetValue(ModeProperty, value); }
+ }
+ public static readonly DependencyProperty ModeProperty =
+ DependencyProperty.Register("Mode", typeof(TouchKeyboardMode), typeof(TouchKeyboard), new PropertyMetadata(TouchKeyboardMode.AlphaNumeric));
+
+ public KeyboardActionKeyMode ActionKeyMode
+ {
+ get { return (KeyboardActionKeyMode)GetValue(ActionKeyModeProperty); }
+ set { SetValue(ActionKeyModeProperty, value); }
+ }
+ public static readonly DependencyProperty ActionKeyModeProperty =
+ DependencyProperty.Register("ActionKeyMode", typeof(KeyboardActionKeyMode), typeof(TouchKeyboard), new PropertyMetadata(KeyboardActionKeyMode.Tab, (d, e) => (d as TouchKeyboard).OnActionKeyModeChanged()));
+
+ public String ActionKeyText
+ {
+ get { return (String)GetValue(ActionKeyTextProperty); }
+ private set { SetValue(ActionKeyTextProperty, value); }
+ }
+ public static readonly DependencyProperty ActionKeyTextProperty =
+ DependencyProperty.Register("ActionKeyText", typeof(String), typeof(TouchKeyboard), new PropertyMetadata(null));
+
+ public KeyboardDefinition CurrentKeyboardDefinition
+ {
+ get { return (KeyboardDefinition)GetValue(CurrentKeyboardDefinitionProperty); }
+ set { SetValue(CurrentKeyboardDefinitionProperty, value); }
+ }
+ public static readonly DependencyProperty CurrentKeyboardDefinitionProperty =
+ DependencyProperty.Register("CurrentKeyboardDefinition", typeof(KeyboardDefinition), typeof(TouchKeyboard), new PropertyMetadata(null));
+
+ public int CurrentKeyboardDefinitionIndex
+ {
+ get { return (int)GetValue(CurrentKeyboardDefinitionIndexProperty); }
+ set { SetValue(CurrentKeyboardDefinitionIndexProperty, value); }
+ }
+ public static readonly DependencyProperty CurrentKeyboardDefinitionIndexProperty =
+ DependencyProperty.Register("CurrentKeyboardDefinitionIndex", typeof(int), typeof(TouchKeyboard), new PropertyMetadata(0));
+
+ public ObservableCollection<KeyboardDefinition> KeyboardDefinitions
+ {
+ get { return (ObservableCollection<KeyboardDefinition>)GetValue(KeyboardDefinitionsProperty); }
+ set { SetValue(KeyboardDefinitionsProperty, value); }
+ }
+ public static readonly DependencyProperty KeyboardDefinitionsProperty =
+ DependencyProperty.Register("KeyboardDefinitions", typeof(ObservableCollection<KeyboardDefinition>), typeof(TouchKeyboard), new PropertyMetadata(null));
+
+ public Size KeySize
+ {
+ get { return (Size)GetValue(KeySizeProperty); }
+ set { SetValue(KeySizeProperty, value); }
+ }
+ public static readonly DependencyProperty KeySizeProperty =
+ DependencyProperty.Register("KeySize", typeof(Size), typeof(TouchKeyboard), new PropertyMetadata(Size.Empty));
+
+ public double MaxSpecialKeyWidth
+ {
+ get { return (double)GetValue(MaxSpecialKeyWidthProperty); }
+ set { SetValue(MaxSpecialKeyWidthProperty, value); }
+ }
+ public static readonly DependencyProperty MaxSpecialKeyWidthProperty =
+ DependencyProperty.Register("MaxSpecialKeyWidth", typeof(double), typeof(TouchKeyboard), new PropertyMetadata(0.0));
+
+ public KeysLineDefinition NumbersLineDefinition
+ {
+ get { return (KeysLineDefinition)GetValue(NumbersLineDefinitionProperty); }
+ set { SetValue(NumbersLineDefinitionProperty, value); }
+ }
+ public static readonly DependencyProperty NumbersLineDefinitionProperty =
+ DependencyProperty.Register("NumbersLineDefinition", typeof(KeysLineDefinition), typeof(TouchKeyboard), new PropertyMetadata(null));
+
+ public Brush CharactersBackground
+ {
+ get { return (Brush)GetValue(CharactersBackgroundProperty); }
+ set { SetValue(CharactersBackgroundProperty, value); }
+ }
+ public static readonly DependencyProperty CharactersBackgroundProperty =
+ DependencyProperty.Register("CharactersBackground", typeof(Brush), typeof(TouchKeyboard), new PropertyMetadata(Brushes.Gainsboro));
+
+ public Brush CharactersForeground
+ {
+ get { return (Brush)GetValue(CharactersForegroundProperty); }
+ set { SetValue(CharactersForegroundProperty, value); }
+ }
+ public static readonly DependencyProperty CharactersForegroundProperty =
+ DependencyProperty.Register("CharactersForeground", typeof(Brush), typeof(TouchKeyboard), new PropertyMetadata(new SolidColorBrush(Color.FromRgb(20, 20, 20))));
+
+ public Brush SpecialCharactersBackground
+ {
+ get { return (Brush)GetValue(SpecialCharactersBackgroundProperty); }
+ set { SetValue(SpecialCharactersBackgroundProperty, value); }
+ }
+ public static readonly DependencyProperty SpecialCharactersBackgroundProperty =
+ DependencyProperty.Register("SpecialCharactersBackground", typeof(Brush), typeof(TouchKeyboard), new PropertyMetadata(Brushes.Gray));
+
+ public Brush SpecialCharactersForeground
+ {
+ get { return (Brush)GetValue(SpecialCharactersForegroundProperty); }
+ set { SetValue(SpecialCharactersForegroundProperty, value); }
+ }
+ public static readonly DependencyProperty SpecialCharactersForegroundProperty =
+ DependencyProperty.Register("SpecialCharactersForeground", typeof(Brush), typeof(TouchKeyboard), new PropertyMetadata(Brushes.Gainsboro));
+
+ public double VectorMarkupSize
+ {
+ get { return (double)GetValue(VectorMarkupSizeProperty); }
+ set { SetValue(VectorMarkupSizeProperty, value); }
+ }
+ public static readonly DependencyProperty VectorMarkupSizeProperty =
+ DependencyProperty.Register("VectorMarkupSize", typeof(double), typeof(TouchKeyboard), new PropertyMetadata(10.0));
+
+ public double DotsSize
+ {
+ get { return (double)GetValue(DotsSizeProperty); }
+ set { SetValue(DotsSizeProperty, value); }
+ }
+ public static readonly DependencyProperty DotsSizeProperty =
+ DependencyProperty.Register("DotsSize", typeof(double), typeof(TouchKeyboard), new PropertyMetadata(5.0));
+
+ public double CharactersCornerRadius
+ {
+ get { return (double)GetValue(CharactersCornerRadiusProperty); }
+ set { SetValue(CharactersCornerRadiusProperty, value); }
+ }
+ public static readonly DependencyProperty CharactersCornerRadiusProperty =
+ DependencyProperty.Register("CharactersCornerRadius", typeof(double), typeof(TouchKeyboard), new PropertyMetadata(5.0));
+
+ public CapsLockMode CapsLockMode
+ {
+ get { return (CapsLockMode)GetValue(CapsLockModeProperty); }
+ set { SetValue(CapsLockModeProperty, value); }
+ }
+ public static readonly DependencyProperty CapsLockModeProperty =
+ DependencyProperty.Register("CapsLockMode", typeof(CapsLockMode), typeof(TouchKeyboard), new PropertyMetadata(CapsLockMode.None));
+
+ public bool IsCapsLockOn
+ {
+ get { return (bool)GetValue(IsCapsLockOnProperty); }
+ private set { SetValue(IsCapsLockOnProperty, value); }
+ }
+ public static readonly DependencyProperty IsCapsLockOnProperty =
+ DependencyProperty.Register("IsCapsLockOn", typeof(bool), typeof(TouchKeyboard), new PropertyMetadata(false));
+
+ public RelayCommand<KeyDefinition> KeyDefinitionCommand
+ {
+ get { return (RelayCommand<KeyDefinition>)GetValue(KeyDefinitionCommandProperty); }
+ set { SetValue(KeyDefinitionCommandProperty, value); }
+ }
+ public static readonly DependencyProperty KeyDefinitionCommandProperty =
+ DependencyProperty.Register("KeyDefinitionCommand", typeof(RelayCommand<KeyDefinition>), typeof(TouchKeyboard), new PropertyMetadata(null));
+
+ public RelayCommand<SpecialKeyDefinition> SpecialKeyDefinitionCommand
+ {
+ get { return (RelayCommand<SpecialKeyDefinition>)GetValue(SpecialKeyDefinitionCommandProperty); }
+ set { SetValue(SpecialKeyDefinitionCommandProperty, value); }
+ }
+ public static readonly DependencyProperty SpecialKeyDefinitionCommandProperty =
+ DependencyProperty.Register("SpecialKeyDefinitionCommand", typeof(RelayCommand<SpecialKeyDefinition>), typeof(TouchKeyboard), new PropertyMetadata(null));
+
+ public RelayCommand SpecialCharactersCommand
+ {
+ get { return (RelayCommand)GetValue(SpecialCharactersCommandProperty); }
+ set { SetValue(SpecialCharactersCommandProperty, value); }
+ }
+ public static readonly DependencyProperty SpecialCharactersCommandProperty =
+ DependencyProperty.Register("SpecialCharactersCommand", typeof(RelayCommand), typeof(TouchKeyboard), new PropertyMetadata(null));
+
+ public RelayCommand<String> FreeTextCommand
+ {
+ get { return (RelayCommand<String>)GetValue(FreeTextCommandProperty); }
+ set { SetValue(FreeTextCommandProperty, value); }
+ }
+ public static readonly DependencyProperty FreeTextCommandProperty =
+ DependencyProperty.Register("FreeTextCommand", typeof(RelayCommand<String>), typeof(TouchKeyboard), new PropertyMetadata(null));
+
+ public RelayCommand NextLanguageCommand
+ {
+ get { return (RelayCommand)GetValue(NextLanguageCommandProperty); }
+ set { SetValue(NextLanguageCommandProperty, value); }
+ }
+ public static readonly DependencyProperty NextLanguageCommandProperty =
+ DependencyProperty.Register("NextLanguageCommand", typeof(RelayCommand), typeof(TouchKeyboard), new PropertyMetadata(null));
+
+ public RelayCommand ActionKeyCommand
+ {
+ get { return (RelayCommand)GetValue(ActionKeyCommandProperty); }
+ set { SetValue(ActionKeyCommandProperty, value); }
+ }
+ public static readonly DependencyProperty ActionKeyCommandProperty =
+ DependencyProperty.Register("ActionKeyCommand", typeof(RelayCommand), typeof(TouchKeyboard), new PropertyMetadata(null));
+
+ public RelayCommand<Object> NumericKeyCommand
+ {
+ get { return (RelayCommand<Object>)GetValue(NumericKeyCommandProperty); }
+ set { SetValue(NumericKeyCommandProperty, value); }
+ }
+ public static readonly DependencyProperty NumericKeyCommandProperty =
+ DependencyProperty.Register("NumericKeyCommand", typeof(RelayCommand<Object>), typeof(TouchKeyboard), new PropertyMetadata(null));
+
+
+ public TouchKeyboard()
+ {
+ KeyboardDefinitions = new ObservableCollection<KeyboardDefinition>();
+ Initialize();
+
+ this.SizeChanged += (_, __) => SetKeySize();
+ KeyDefinitionCommand = new RelayCommand<KeyDefinition>(InvokeKeyDefinition);
+ SpecialKeyDefinitionCommand = new RelayCommand<SpecialKeyDefinition>(InvokeSpecialKeyDefinition);
+ SpecialCharactersCommand = new RelayCommand(ToggleSpecialKeys);
+ FreeTextCommand = new RelayCommand<string>((x) => SendKeys(x));
+ NextLanguageCommand = new RelayCommand(NextLanguage);
+ ActionKeyCommand = new RelayCommand(InvokeActionKey);
+ NumericKeyCommand = new RelayCommand<object>((x) => SendKeys(x.ToString().Replace("'", "")));
+ }
+
+ private void Initialize()
+ {
+ if (!_isInitialized)
+ {
+ var numbers = new KeysLineDefinition();
+
+ for (int i = 1; i < 10; i++)
+ {
+ numbers.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = i.ToString(),
+ });
+ }
+
+ numbers.KeyDefinitions.Add(new KeyDefinition()
+ {
+ StandardText = "0",
+ });
+
+ NumbersLineDefinition = numbers;
+
+ CurrentKeyboardDefinition = KeyboardDefinition.Default;
+ KeyboardDefinitions.Add(CurrentKeyboardDefinition);
+ KeyboardDefinitions.Add(KeyboardDefinition.CreateDefaultHebrewAlphaNumeric());
+
+ SetKeySize();
+
+ OnActionKeyModeChanged();
+
+ _isInitialized = true;
+ }
+ }
+
+ private void SetKeySize()
+ {
+ KeySize = new Size(ActualWidth / NumbersLineDefinition.KeyDefinitions.Count, (ActualWidth / NumbersLineDefinition.KeyDefinitions.Count) * 0.90);
+ MaxSpecialKeyWidth = KeySize.Width * 2;
+ }
+
+ private void InvokeKeyDefinition(KeyDefinition key)
+ {
+ if (IsCapsLockOn)
+ {
+ SendKeys(key.CapsText);
+ }
+ else
+ {
+ //UIAutomationHelper.GetActiveWindow();
+
+ //IInputElement focusedControl = FocusManager.GetFocusedElement(this);
+
+ SendKeys(key.StandardText);
+ }
+ }
+
+ private void InvokeSpecialKeyDefinition(SpecialKeyDefinition key)
+ {
+ switch (key.Type)
+ {
+ case SpecialKeyType.StandardText:
+ SendKeys(key.Output);
+ break;
+ case SpecialKeyType.CapsLock:
+
+ if (CapsLockMode == CapsLockMode.None)
+ {
+ CapsLockMode = CapsLockMode.SingleChar;
+ }
+ else if (CapsLockMode == CapsLockMode.SingleChar)
+ {
+ CapsLockMode = CapsLockMode.Locked;
+ }
+ else
+ {
+ CapsLockMode = CapsLockMode.None;
+ }
+
+ IsCapsLockOn = CapsLockMode != CapsLockMode.None;
+
+ break;
+ }
+ }
+
+ private Task SendKeys(String key)
+ {
+ Application.Current.MainWindow.Activate();
+
+ var isSpecialChar = IsSpecialCharactersOn;
+ var definition = CurrentKeyboardDefinition;
+
+ if (CapsLockMode == CapsLockMode.SingleChar)
+ {
+ CapsLockMode = CapsLockMode.None;
+ IsCapsLockOn = false;
+ }
+
+ return Task.Factory.StartNew(() =>
+ {
+ if (isSpecialChar && definition.KeysLinesDefinitions.SelectMany(x => x.KeyDefinitions).Select(x => x.StandardText).Contains(key))
+ {
+ Forms.SendKeys.SendWait("{" + key + "}");
+ }
+ else
+ {
+ Forms.SendKeys.SendWait(key);
+ }
+ });
+ }
+
+ private void OnSpecialCharactersOnChanged()
+ {
+ if (!IsSpecialCharactersOn)
+ {
+ CurrentKeyboardDefinition = KeyboardDefinitions[CurrentKeyboardDefinitionIndex];
+ }
+ else
+ {
+ KeyboardDefinition definition = new KeyboardDefinition();
+ definition.EnterText = CurrentKeyboardDefinition.EnterText;
+ definition.KeysLinesDefinitions = KeyboardDefinition.CreateDefaultSpecialCharacters();
+ CurrentKeyboardDefinition = definition;
+ }
+ }
+
+ private void ToggleSpecialKeys()
+ {
+ IsSpecialCharactersOn = !IsSpecialCharactersOn;
+ }
+
+ private void NextLanguage()
+ {
+ IsCapsLockOn = false;
+
+ CurrentKeyboardDefinitionIndex++;
+
+ if (CurrentKeyboardDefinitionIndex > KeyboardDefinitions.Count - 1)
+ {
+ CurrentKeyboardDefinitionIndex = 0;
+ }
+
+ CurrentKeyboardDefinition = KeyboardDefinitions[CurrentKeyboardDefinitionIndex];
+
+ OnActionKeyModeChanged();
+ }
+
+ private void OnActionKeyModeChanged()
+ {
+ switch (ActionKeyMode)
+ {
+ case KeyboardActionKeyMode.Enter:
+ ActionKeyText = CurrentKeyboardDefinition.EnterText;
+ break;
+ case KeyboardActionKeyMode.Tab:
+ ActionKeyText = CurrentKeyboardDefinition.TabText;
+ break;
+ case KeyboardActionKeyMode.Search:
+ ActionKeyText = "Search"; // TODO: Make trigger in view and vector path.
+ break;
+ }
+ }
+
+ private void InvokeActionKey()
+ {
+ switch (ActionKeyMode)
+ {
+ case KeyboardActionKeyMode.Enter:
+ SendKeys("{ENTER}");
+ break;
+ case KeyboardActionKeyMode.Tab:
+ SendKeys("{TAB}");
+ break;
+ case KeyboardActionKeyMode.Search:
+ SendKeys("{ENTER}");
+ break;
+ }
+
+ ActionKeyPressed?.Invoke(this, ActionKeyMode);
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.xaml b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.xaml
new file mode 100644
index 000000000..b429d1a31
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.xaml
@@ -0,0 +1,451 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:local="clr-namespace:Tango.Touch.Keyboard"
+ xmlns:fa="http://schemas.fontawesome.io/icons/">
+
+
+ <Style TargetType="{x:Type local:TouchKeyboard}">
+ <Style.Resources>
+ <local:KeyboardModeToVisibilityConverter x:Key="KeyboardModeToVisibilityConverter" />
+ <local:KeyboardModeToVisibilityInverseConverter x:Key="KeyboardModeToVisibilityInverseConverter" />
+ <local:SpecialKeyDefinitionToWidthConverter x:Key="SpecialKeyDefinitionToWidthConverter" />
+ <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" />
+ <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
+ <converters:MathOperatorConverter x:Key="MathOperatorConverter" />
+ </Style.Resources>
+
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type local:TouchKeyboard}">
+ <Grid DataContext="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard}}">
+
+ <Grid.Resources>
+ <Style x:Key="keyboardButton" TargetType="RepeatButton">
+ <Setter Property="Background" Value="Transparent" />
+ <Setter Property="Focusable" Value="False"></Setter>
+ <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="RepeatButton">
+ <Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersCornerRadius}">
+ <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ <Style.Triggers>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter Property="Opacity" Value="0.5"></Setter>
+ </Trigger>
+ <Trigger Property="RepeatButton.IsPressed" Value="True">
+ <Setter Property="Opacity" Value="0.8"></Setter>
+ </Trigger>
+ <EventTrigger RoutedEvent="RepeatButton.TouchDown">
+ <EventTrigger.Actions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
+ <DiscreteDoubleKeyFrame KeyTime="0">
+ <DiscreteDoubleKeyFrame.Value>
+ 0.8
+ </DiscreteDoubleKeyFrame.Value>
+ </DiscreteDoubleKeyFrame>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </BeginStoryboard>
+ </EventTrigger.Actions>
+ </EventTrigger>
+ <EventTrigger RoutedEvent="RepeatButton.TouchUp">
+ <EventTrigger.Actions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
+ <DiscreteDoubleKeyFrame KeyTime="0">
+ <DiscreteDoubleKeyFrame.Value>
+ 1
+ </DiscreteDoubleKeyFrame.Value>
+ </DiscreteDoubleKeyFrame>
+ </DoubleAnimationUsingKeyFrames>
+ </Storyboard>
+ </BeginStoryboard>
+ </EventTrigger.Actions>
+ </EventTrigger>
+ </Style.Triggers>
+ </Style>
+
+ <Style x:Key="normalButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
+ <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersBackground}"></Setter>
+ <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersForeground}"></Setter>
+ <Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeySize.Width}"></Setter>
+ <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeySize.Height}"></Setter>
+ <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeyDefinitionCommand}"></Setter>
+ <Setter Property="CommandParameter" Value="{Binding}"></Setter>
+ </Style>
+
+ <Style x:Key="numberButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
+ <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersBackground}"></Setter>
+ <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersForeground}"></Setter>
+ <Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeySize.Width}"></Setter>
+ <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeySize.Height}"></Setter>
+ <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeyDefinitionCommand}"></Setter>
+ <Setter Property="CommandParameter" Value="{Binding}"></Setter>
+ </Style>
+
+ <Style x:Key="specialButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
+ <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersBackground}"></Setter>
+ <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersForeground}"></Setter>
+ <Setter Property="Width">
+ <Setter.Value>
+ <MultiBinding Converter="{StaticResource SpecialKeyDefinitionToWidthConverter}">
+ <Binding RelativeSource="{RelativeSource AncestorType=local:TouchKeyboard}" Path="KeySize"></Binding>
+ <Binding Path="ColumnSpan"></Binding>
+ </MultiBinding>
+ </Setter.Value>
+ </Setter>
+ <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeySize.Height}"></Setter>
+ <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialKeyDefinitionCommand}"></Setter>
+ <Setter Property="CommandParameter" Value="{Binding}"></Setter>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="RepeatButton">
+ <Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersCornerRadius}">
+ <Grid>
+ <Viewbox Stretch="Uniform" Width="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=VectorMarkupSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=VectorMarkupSize}">
+ <Path Data="{Binding VectorMarkup}" Width="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=VectorMarkupSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=VectorMarkupSize}" Stretch="Uniform">
+ <Path.Style>
+ <Style TargetType="Path">
+ <Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource AncestorType=RepeatButton},Path=Foreground}"></Setter>
+ <Style.Triggers>
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CapsLockMode}" Value="{x:Static local:CapsLockMode.Locked}" />
+ <Condition Binding="{Binding Type}" Value="{x:Static local:SpecialKeyType.CapsLock}" />
+ </MultiDataTrigger.Conditions>
+ <Setter Property="Fill" Value="#47C904"></Setter>
+ </MultiDataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Path.Style>
+ </Path>
+ </Viewbox>
+
+ <Ellipse Margin="2" HorizontalAlignment="Right" VerticalAlignment="Top" Width="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=DotsSize}">
+ <Ellipse.Style>
+ <Style TargetType="Ellipse">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ <Setter Property="Fill" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersForeground}"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=IsCapsLockOn}" Value="True">
+ <Setter Property="Fill" Value="#47C904"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Type}" Value="{x:Static local:SpecialKeyType.CapsLock}">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Ellipse.Style>
+ </Ellipse>
+ </Grid>
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="bottomButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
+ <Setter Property="Delay" Value="100000"></Setter>
+ <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersBackground}"></Setter>
+ <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersForeground}"></Setter>
+ <Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeySize.Width}"></Setter>
+ <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeySize.Height}"></Setter>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="RepeatButton">
+ <Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersCornerRadius}">
+ <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="bottomButtonDots" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
+ <Setter Property="Delay" Value="100000"></Setter>
+ <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersBackground}"></Setter>
+ <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersForeground}"></Setter>
+ <Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeySize.Width}"></Setter>
+ <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeySize.Height}"></Setter>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="RepeatButton">
+ <Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersCornerRadius}">
+ <Grid>
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="2">
+ <Ellipse Margin="0 0 2 0" Width="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=DotsSize}" Fill="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersForeground}" />
+ <Ellipse Margin="0 0 2 0" Width="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=DotsSize}" Fill="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersForeground}" />
+ <Ellipse Margin="0 0 2 0" Width="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=DotsSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=DotsSize}" Fill="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersForeground}" />
+ </StackPanel>
+ <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
+ </Grid>
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="stretchedButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
+ <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersBackground}"></Setter>
+ <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersForeground}"></Setter>
+ <Setter Property="MinWidth" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeySize.Width}"></Setter>
+ <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=KeySize.Height}"></Setter>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="RepeatButton">
+ <Border BorderThickness="0 0 0 1" BorderBrush="#202020" Background="{TemplateBinding Background}" Margin="4" CornerRadius="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersCornerRadius}">
+ <ContentPresenter HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="numericButton" TargetType="RepeatButton" BasedOn="{StaticResource keyboardButton}">
+ <Setter Property="Background" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersBackground}"></Setter>
+ <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersForeground}"></Setter>
+ <Setter Property="Height" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualWidth,Converter={StaticResource MathOperatorConverter},ConverterParameter='*0.7'}"></Setter>
+ <Setter Property="Command" Value="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=NumericKeyCommand}"></Setter>
+ <Setter Property="CommandParameter" Value="{Binding RelativeSource={RelativeSource Self},Path=Tag}"></Setter>
+ </Style>
+ </Grid.Resources>
+
+ <!--AlphaNumeric-->
+ <Grid>
+ <Grid.Style>
+ <Style TargetType="Grid">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Integer}">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Float}">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Grid.Style>
+
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+
+ <ItemsControl ItemsSource="{Binding NumbersLineDefinition.KeyDefinitions}">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <UniformGrid Columns="{Binding NumbersLineDefinition.KeyDefinitions.Count}"></UniformGrid>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <RepeatButton Content="{Binding StandardText}" Style="{StaticResource numberButton}"></RepeatButton>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+
+ <Grid Grid.Row="1">
+ <ItemsControl ItemsSource="{Binding CurrentKeyboardDefinition.KeysLinesDefinitions}">
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="Auto" />
+ <ColumnDefinition Width="1*" />
+ </Grid.ColumnDefinitions>
+
+ <ItemsControl ItemsSource="{Binding SpecialLeftKeyDefinitions}" HorizontalAlignment="Left">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <UniformGrid Rows="1" HorizontalAlignment="Stretch"></UniformGrid>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <RepeatButton Style="{StaticResource specialButton}"/>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+
+ <ItemsControl ItemsSource="{Binding SpecialRightKeyDefinitions}" Grid.Column="2" HorizontalAlignment="Right">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <UniformGrid Rows="1" HorizontalAlignment="Stretch"></UniformGrid>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <RepeatButton Style="{StaticResource specialButton}"/>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+
+ <ItemsControl ItemsSource="{Binding KeyDefinitions}" Grid.Column="1">
+ <ItemsControl.ItemsPanel>
+ <ItemsPanelTemplate>
+ <UniformGrid Rows="1" HorizontalAlignment="Center"></UniformGrid>
+ </ItemsPanelTemplate>
+ </ItemsControl.ItemsPanel>
+ <ItemsControl.ItemTemplate>
+ <DataTemplate>
+ <RepeatButton Style="{StaticResource normalButton}">
+ <TextBlock>
+ <TextBlock.Style>
+ <Style TargetType="TextBlock">
+ <Setter Property="Text" Value="{Binding StandardText}"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=IsCapsLockOn}" Value="True">
+ <Setter Property="Text" Value="{Binding CapsText}"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
+ </TextBlock>
+ </RepeatButton>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </Grid>
+ </DataTemplate>
+ </ItemsControl.ItemTemplate>
+ </ItemsControl>
+ </Grid>
+
+ <Grid Grid.Row="2">
+ <Grid>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="1*"/>
+ <ColumnDefinition Width="Auto"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+
+ <RepeatButton Style="{StaticResource bottomButtonDots}" Command="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersCommand}">
+ <ContentControl>
+ <ContentControl.Style>
+ <Style TargetType="ContentControl">
+ <Setter Property="Content">
+ <Setter.Value>
+ <StackPanel Orientation="Horizontal">
+ <fa:ImageAwesome Icon="ShareAlt" Foreground="{Binding RelativeSource={RelativeSource AncestorType=RepeatButton},Path=Foreground}" Width="10" />
+ <TextBlock Margin="5 0 0 0">1#</TextBlock>
+ </StackPanel>
+ </Setter.Value>
+ </Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding IsSpecialCharactersOn}" Value="True">
+ <Setter Property="Content">
+ <Setter.Value>
+ <TextBlock>abc</TextBlock>
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </ContentControl.Style>
+ </ContentControl>
+ </RepeatButton>
+
+ <RepeatButton Command="{Binding NextLanguageCommand}" Style="{StaticResource bottomButtonDots}" Grid.Column="1" Visibility="{Binding IsSpecialCharactersOn,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
+ <TextBlock Text="{Binding CurrentKeyboardDefinition.LanguageCode}"></TextBlock>
+ </RepeatButton>
+
+ <RepeatButton Command="{Binding FreeTextCommand}" CommandParameter="/" Style="{StaticResource bottomButton}" Grid.Column="2" Visibility="{Binding IsSpecialCharactersOn,Converter={StaticResource BooleanToVisibilityInverseConverter}}">
+ <TextBlock Text="/"></TextBlock>
+ </RepeatButton>
+
+ <RepeatButton Style="{StaticResource stretchedButton}" Grid.Column="3" Command="{Binding FreeTextCommand}" CommandParameter=" ">
+ <DockPanel Margin="20 0" Height="10">
+ <Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Left" Stroke="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersForeground}" StrokeThickness="1" DockPanel.Dock="Left" />
+ <Rectangle VerticalAlignment="Stretch" HorizontalAlignment="Right" Stroke="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersForeground}" StrokeThickness="1" DockPanel.Dock="Right" />
+ <Rectangle VerticalAlignment="Bottom" HorizontalAlignment="Stretch" Stroke="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=CharactersForeground}" StrokeThickness="1" />
+ </DockPanel>
+ </RepeatButton>
+
+ <RepeatButton Command="{Binding FreeTextCommand}" CommandParameter="." Style="{StaticResource bottomButtonDots}" Grid.Column="4">
+ <TextBlock Text="."></TextBlock>
+ </RepeatButton>
+
+ <RepeatButton Style="{StaticResource bottomButton}" Grid.Column="5" Command="{Binding ActionKeyCommand}">
+ <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=ActionKeyText}"></TextBlock>
+ </RepeatButton>
+ </Grid>
+ </Grid>
+ </Grid>
+ <!--AlphaNumeric-->
+
+ <!--Numeric-->
+ <Grid>
+ <Grid.Style>
+ <Style TargetType="Grid">
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Integer}">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Float}">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Grid.Style>
+ <UniformGrid Rows="4" Columns="4">
+ <RepeatButton Style="{StaticResource numericButton}" Tag="1">1</RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" Tag="2">2</RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" Tag="3">3</RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" Tag="'{BACKSPACE}'" Background="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersBackground}" Foreground="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=SpecialCharactersForeground}">
+ <Viewbox Stretch="Uniform" Width="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=VectorMarkupSize}" Height="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=VectorMarkupSize}">
+ <Path Fill="{Binding RelativeSource={RelativeSource AncestorType=RepeatButton},Path=Foreground}" Data="M561 76.5H178.5c-17.85 0-30.6 7.65-40.8 22.95L0 306l137.7 206.55c10.2 12.75 22.95 22.95 40.8 22.95H561 c28.05 0 51-22.95 51-51v-357C612 99.45 589.05 76.5 561 76.5z M484.5 397.8l-35.7 35.7L357 341.7l-91.8 91.8l-35.7-35.7 l91.8-91.8l-91.8-91.8l35.7-35.7l91.8 91.8l91.8-91.8l35.7 35.7L392.7 306L484.5 397.8z"></Path>
+ </Viewbox>
+ </RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" Tag="4">4</RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" Tag="5">5</RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" Tag="6">6</RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" IsEnabled="False"></RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" Tag="7">7</RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" Tag="8">8</RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" Tag="9">9</RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" IsEnabled="False"></RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" IsEnabled="False"></RepeatButton>
+ <RepeatButton Style="{StaticResource numericButton}" Tag="0">0</RepeatButton>
+ <RepeatButton Tag=".">
+ <RepeatButton.Style>
+ <Style TargetType="RepeatButton" BasedOn="{StaticResource numericButton}">
+ <Setter Property="Content" Value=" "></Setter>
+ <Setter Property="IsEnabled" Value="False"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding Mode}" Value="{x:Static local:TouchKeyboardMode.Float}">
+ <Setter Property="Content" Value="."></Setter>
+ <Setter Property="IsEnabled" Value="True"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </RepeatButton.Style>
+ </RepeatButton>
+ <RepeatButton Style="{StaticResource bottomButton}" Grid.Column="5" Command="{Binding ActionKeyCommand}" Height="{Binding RelativeSource={RelativeSource Self},Path=ActualWidth,Converter={StaticResource MathOperatorConverter},ConverterParameter='*0.7'}">
+ <TextBlock Text="{Binding RelativeSource={RelativeSource AncestorType=local:TouchKeyboard},Path=ActionKeyText}"></TextBlock>
+ </RepeatButton>
+ </UniformGrid>
+ </Grid>
+ <!--Numeric-->
+
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+</ResourceDictionary> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboardMode.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboardMode.cs
new file mode 100644
index 000000000..a087ebb4d
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboardMode.cs
@@ -0,0 +1,16 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Tango.Touch.Keyboard
+{
+ public enum TouchKeyboardMode
+ {
+ AlphaNumeric,
+ Integer,
+ Float,
+ Alpha
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Properties/AssemblyInfo.cs b/Software/Visual_Studio/Tango.Touch/Properties/AssemblyInfo.cs
new file mode 100644
index 000000000..8ffc1d7c8
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Properties/AssemblyInfo.cs
@@ -0,0 +1,17 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+[assembly: AssemblyTitle("Tango - Touch Components")]
+[assembly: ComVisible(false)]
+
+[assembly:ThemeInfo(
+ ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
+ //(used if a resource is not found in the page,
+ // or application resource dictionaries)
+ ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
+ //(used if a resource is not found in the page,
+ // app, or any theme specific resource dictionaries)
+)]
diff --git a/Software/Visual_Studio/Tango.Touch/Properties/Resources.Designer.cs b/Software/Visual_Studio/Tango.Touch/Properties/Resources.Designer.cs
new file mode 100644
index 000000000..c664b142f
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Properties/Resources.Designer.cs
@@ -0,0 +1,62 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Tango.Touch.Properties {
+
+
+ /// <summary>
+ /// A strongly-typed resource class, for looking up localized strings, etc.
+ /// </summary>
+ // This class was auto-generated by the StronglyTypedResourceBuilder
+ // class via a tool like ResGen or Visual Studio.
+ // To add or remove a member, edit your .ResX file then rerun ResGen
+ // with the /str option, or rebuild your VS project.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources() {
+ }
+
+ /// <summary>
+ /// Returns the cached ResourceManager instance used by this class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager {
+ get {
+ if ((resourceMan == null)) {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Tango.Touch.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ /// <summary>
+ /// Overrides the current thread's CurrentUICulture property for all
+ /// resource lookups using this strongly typed resource class.
+ /// </summary>
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture {
+ get {
+ return resourceCulture;
+ }
+ set {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Properties/Resources.resx b/Software/Visual_Studio/Tango.Touch/Properties/Resources.resx
new file mode 100644
index 000000000..af7dbebba
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Properties/Resources.resx
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="utf-8"?>
+<root>
+ <!--
+ Microsoft ResX Schema
+
+ Version 2.0
+
+ The primary goals of this format is to allow a simple XML format
+ that is mostly human readable. The generation and parsing of the
+ various data types are done through the TypeConverter classes
+ associated with the data types.
+
+ Example:
+
+ ... ado.net/XML headers & schema ...
+ <resheader name="resmimetype">text/microsoft-resx</resheader>
+ <resheader name="version">2.0</resheader>
+ <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+ <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+ <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+ <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+ <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+ <value>[base64 mime encoded serialized .NET Framework object]</value>
+ </data>
+ <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+ <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+ <comment>This is a comment</comment>
+ </data>
+
+ There are any number of "resheader" rows that contain simple
+ name/value pairs.
+
+ Each data row contains a name, and value. The row also contains a
+ type or mimetype. Type corresponds to a .NET class that support
+ text/value conversion through the TypeConverter architecture.
+ Classes that don't support this are serialized and stored with the
+ mimetype set.
+
+ The mimetype is used for serialized objects, and tells the
+ ResXResourceReader how to depersist the object. This is currently not
+ extensible. For a given mimetype the value must be set accordingly:
+
+ Note - application/x-microsoft.net.object.binary.base64 is the format
+ that the ResXResourceWriter will generate, however the reader can
+ read any of the formats listed below.
+
+ mimetype: application/x-microsoft.net.object.binary.base64
+ value : The object must be serialized with
+ : System.Serialization.Formatters.Binary.BinaryFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.soap.base64
+ value : The object must be serialized with
+ : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+ : and then encoded with base64 encoding.
+
+ mimetype: application/x-microsoft.net.object.bytearray.base64
+ value : The object must be serialized into a byte array
+ : using a System.ComponentModel.TypeConverter
+ : and then encoded with base64 encoding.
+ -->
+ <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+ <xsd:element name="root" msdata:IsDataSet="true">
+ <xsd:complexType>
+ <xsd:choice maxOccurs="unbounded">
+ <xsd:element name="metadata">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" />
+ <xsd:attribute name="type" type="xsd:string" />
+ <xsd:attribute name="mimetype" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="assembly">
+ <xsd:complexType>
+ <xsd:attribute name="alias" type="xsd:string" />
+ <xsd:attribute name="name" type="xsd:string" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="data">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
+ <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+ <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+ </xsd:complexType>
+ </xsd:element>
+ <xsd:element name="resheader">
+ <xsd:complexType>
+ <xsd:sequence>
+ <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+ </xsd:sequence>
+ <xsd:attribute name="name" type="xsd:string" use="required" />
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:choice>
+ </xsd:complexType>
+ </xsd:element>
+ </xsd:schema>
+ <resheader name="resmimetype">
+ <value>text/microsoft-resx</value>
+ </resheader>
+ <resheader name="version">
+ <value>2.0</value>
+ </resheader>
+ <resheader name="reader">
+ <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+ <resheader name="writer">
+ <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+ </resheader>
+</root> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Touch/Properties/Settings.Designer.cs b/Software/Visual_Studio/Tango.Touch/Properties/Settings.Designer.cs
new file mode 100644
index 000000000..4fcc7b647
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+// <auto-generated>
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+// </auto-generated>
+//------------------------------------------------------------------------------
+
+namespace Tango.Touch.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Properties/Settings.settings b/Software/Visual_Studio/Tango.Touch/Properties/Settings.settings
new file mode 100644
index 000000000..033d7a5e9
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Properties/Settings.settings
@@ -0,0 +1,7 @@
+<?xml version='1.0' encoding='utf-8'?>
+<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
+ <Profiles>
+ <Profile Name="(Default)" />
+ </Profiles>
+ <Settings />
+</SettingsFile> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj
new file mode 100644
index 000000000..347abe525
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Tango.Touch.csproj
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProjectGuid>{FD86424C-6E84-491B-8DF9-3D0F5C236A2A}</ProjectGuid>
+ <OutputType>library</OutputType>
+ <RootNamespace>Tango.Touch</RootNamespace>
+ <AssemblyName>Tango.Touch</AssemblyName>
+ <TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>..\Build\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>..\Build\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="FontAwesome.WPF, Version=4.7.0.37774, Culture=neutral, PublicKeyToken=0758b07a11a4f466, processorArchitecture=MSIL">
+ <HintPath>..\packages\FontAwesome.WPF.4.7.0.9\lib\net40\FontAwesome.WPF.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Windows.Forms" />
+ <Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
+ <HintPath>..\packages\Expression.Blend.Sdk.1.0.2\lib\net45\System.Windows.Interactivity.dll</HintPath>
+ <Private>True</Private>
+ </Reference>
+ <Reference Include="System.Xml" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="System.Net.Http" />
+ <Reference Include="System.Xaml">
+ <RequiredTargetFramework>4.0</RequiredTargetFramework>
+ </Reference>
+ <Reference Include="WindowsBase" />
+ <Reference Include="PresentationCore" />
+ <Reference Include="PresentationFramework" />
+ </ItemGroup>
+ <ItemGroup>
+ <Page Include="Keyboard\KeyboardView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Keyboard\TouchKeyboard.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Themes\Generic.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
+ <Compile Include="..\Versioning\GlobalVersionInfo.cs">
+ <Link>GlobalVersionInfo.cs</Link>
+ </Compile>
+ <Compile Include="Keyboard\CapsLockMode.cs" />
+ <Compile Include="Keyboard\KeyboardActionKeyMode.cs" />
+ <Compile Include="Keyboard\KeyboardDefinition.cs" />
+ <Compile Include="Keyboard\KeyboardModeToVisibilityConverter.cs" />
+ <Compile Include="Keyboard\KeyboardModeToVisibilityInverseConverter.cs" />
+ <Compile Include="Keyboard\KeyboardView.cs" />
+ <Compile Include="Keyboard\KeyDefinition.cs" />
+ <Compile Include="Keyboard\KeysLineDefinition.cs" />
+ <Compile Include="Keyboard\SpecialKeyDefinition.cs" />
+ <Compile Include="Keyboard\SpecialKeyDefinitionToWidthConverter.cs" />
+ <Compile Include="Keyboard\SpecialKeyType.cs" />
+ <Compile Include="Keyboard\TouchKeyboard.cs" />
+ <Compile Include="Keyboard\TouchKeyboardMode.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Properties\AssemblyInfo.cs">
+ <SubType>Code</SubType>
+ </Compile>
+ <Compile Include="Properties\Resources.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DesignTime>True</DesignTime>
+ <DependentUpon>Resources.resx</DependentUpon>
+ </Compile>
+ <Compile Include="Properties\Settings.Designer.cs">
+ <AutoGen>True</AutoGen>
+ <DependentUpon>Settings.settings</DependentUpon>
+ <DesignTimeSharedInput>True</DesignTimeSharedInput>
+ </Compile>
+ <EmbeddedResource Include="Properties\Resources.resx">
+ <Generator>ResXFileCodeGenerator</Generator>
+ <LastGenOutput>Resources.Designer.cs</LastGenOutput>
+ </EmbeddedResource>
+ <None Include="app.config" />
+ <None Include="packages.config" />
+ <None Include="Properties\Settings.settings">
+ <Generator>SettingsSingleFileGenerator</Generator>
+ <LastGenOutput>Settings.Designer.cs</LastGenOutput>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\Tango.Core\Tango.Core.csproj">
+ <Project>{a34ee0f0-649d-41c8-8489-b6f1cc6924ee}</Project>
+ <Name>Tango.Core</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\Tango.SharedUI\Tango.SharedUI.csproj">
+ <Project>{8491d07b-c1f6-4b62-a412-41b9fd2d6538}</Project>
+ <Name>Tango.SharedUI</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+</Project> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml
new file mode 100644
index 000000000..c31d2045f
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Themes/Generic.xaml
@@ -0,0 +1,11 @@
+<ResourceDictionary
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:local="clr-namespace:Tango.Touch">
+
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Keyboard/TouchKeyboard.xaml" />
+ <ResourceDictionary Source="pack://application:,,,/Tango.Touch;component/Keyboard/KeyboardView.xaml" />
+ </ResourceDictionary.MergedDictionaries>
+
+</ResourceDictionary>
diff --git a/Software/Visual_Studio/Tango.Touch/app.config b/Software/Visual_Studio/Tango.Touch/app.config
new file mode 100644
index 000000000..462d17b27
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/app.config
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="utf-8"?>
+<configuration>
+ <runtime>
+ <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
+ <dependentAssembly>
+ <assemblyIdentity name="System.Collections.Immutable" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.2.2.0" newVersion="1.2.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Reflection.Metadata" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-1.4.2.0" newVersion="1.4.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.FileSystem" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.ValueTuple" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.Compression" publicKeyToken="b77a5c561934e089" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.1.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.IO.FileSystem.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Security.Cryptography.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.2.0" newVersion="4.0.2.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Console" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
+ </dependentAssembly>
+ <dependentAssembly>
+ <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
+ <bindingRedirect oldVersion="0.0.0.0-4.0.3.0" newVersion="4.0.3.0" />
+ </dependentAssembly>
+ </assemblyBinding>
+ </runtime>
+</configuration> \ No newline at end of file
diff --git a/Software/Visual_Studio/Tango.Touch/packages.config b/Software/Visual_Studio/Tango.Touch/packages.config
new file mode 100644
index 000000000..6d40ff3dd
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/packages.config
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="Expression.Blend.Sdk" version="1.0.2" targetFramework="net46" />
+ <package id="FontAwesome.WPF" version="4.7.0.9" targetFramework="net46" />
+</packages> \ No newline at end of file