aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Keyboard
diff options
context:
space:
mode:
authorRoy Ben Shabat <Roy.mail.net@gmail.com>2019-12-12 01:32:37 +0200
committerRoy Ben Shabat <Roy.mail.net@gmail.com>2019-12-12 01:32:37 +0200
commit217fcb79fa32f858a06d8200697ddee7c5da625a (patch)
treeb90d02265ac3be2a4f74eb6777bfb52ebc36391e /Software/Visual_Studio/Tango.Touch/Keyboard
parent942aae29de03a5a3e0d139974b3754392ee9c1ff (diff)
downloadTango-217fcb79fa32f858a06d8200697ddee7c5da625a.tar.gz
Tango-217fcb79fa32f858a06d8200697ddee7c5da625a.zip
Added IsAfterReset to ConnectionResponse PMR.
Started working on PPC.Browser Module !!!
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Keyboard')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardOutputMode.cs14
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs54
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml2
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs10
4 files changed, 67 insertions, 13 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardOutputMode.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardOutputMode.cs
new file mode 100644
index 000000000..978ae61ca
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardOutputMode.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 KeyboardOutputMode
+ {
+ Wpf,
+ Windows,
+ }
+}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs
index 786a1799a..67203b669 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs
@@ -26,6 +26,8 @@ namespace Tango.Touch.Keyboard
[ContentProperty(nameof(View))]
public partial class KeyboardView : Control
{
+ public event EventHandler KeyboardOpened;
+ public event EventHandler KeyboardClosed;
private static KeyboardView _instance;
private List<Object> _has_focus_objects = new List<object>();
@@ -43,6 +45,19 @@ namespace Tango.Touch.Keyboard
#region Properties
+ public static KeyboardView Default
+ {
+ get { return _instance; }
+ }
+
+ public static TouchKeyboard Keyboard
+ {
+ get
+ {
+ return Default.keyboard;
+ }
+ }
+
public bool IsOpened
{
get { return (bool)GetValue(IsOpenedProperty); }
@@ -59,6 +74,14 @@ namespace Tango.Touch.Keyboard
public static readonly DependencyProperty ViewProperty =
DependencyProperty.Register("View", typeof(FrameworkElement), typeof(KeyboardView), new PropertyMetadata(null));
+ public KeyboardOutputMode OutputMode
+ {
+ get { return (KeyboardOutputMode)GetValue(OutputModeProperty); }
+ set { SetValue(OutputModeProperty, value); }
+ }
+ public static readonly DependencyProperty OutputModeProperty =
+ DependencyProperty.Register("OutputMode", typeof(KeyboardOutputMode), typeof(KeyboardView), new PropertyMetadata(KeyboardOutputMode.Wpf));
+
#endregion
#region Attached Properties
@@ -112,21 +135,30 @@ namespace Tango.Touch.Keyboard
{
if (!IsOpened)
{
- if (GetContainer(_lastFocusedElement) != null)
+ if (OutputMode == KeyboardOutputMode.Wpf)
{
- var scrollViewers = this.FindVisualChildren<LightTouchScrollViewer>().ToList();
+ if (GetContainer(_lastFocusedElement) != null)
+ {
+ var scrollViewers = this.FindVisualChildren<LightTouchScrollViewer>().ToList();
- scrollViewers.ForEach(x => x.DisableScrolling = true);
+ scrollViewers.ForEach(x => x.DisableScrolling = true);
- ThicknessAnimation ani = new ThicknessAnimation();
- ani.Completed += (_, __) =>
- {
- scrollViewers.ForEach(x => x.DisableScrolling = false);
- };
- ani.To = new Thickness(0);
- ani.Duration = TimeSpan.FromSeconds(0.2);
- GetContainer(_lastFocusedElement).BeginAnimation(FrameworkElement.MarginProperty, ani);
+ ThicknessAnimation ani = new ThicknessAnimation();
+ ani.Completed += (_, __) =>
+ {
+ scrollViewers.ForEach(x => x.DisableScrolling = false);
+ };
+ ani.To = new Thickness(0);
+ ani.Duration = TimeSpan.FromSeconds(0.2);
+ GetContainer(_lastFocusedElement).BeginAnimation(FrameworkElement.MarginProperty, ani);
+ }
}
+
+ KeyboardClosed?.Invoke(this, new EventArgs());
+ }
+ else
+ {
+ KeyboardOpened?.Invoke(this, new EventArgs());
}
}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml
index 328820913..8458b4cab 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml
@@ -42,7 +42,7 @@
</Style>
</Grid.Style>
<Border BorderThickness="0 1 0 0" BorderBrush="#404040">
- <local:TouchKeyboard x:Name="PART_Keyboard"></local:TouchKeyboard>
+ <local:TouchKeyboard x:Name="PART_Keyboard" OutputMode="{TemplateBinding OutputMode}"></local:TouchKeyboard>
</Border>
</Grid>
</Grid>
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
index 1856fd2ac..a35b91dd6 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
@@ -67,6 +67,14 @@ namespace Tango.Touch.Keyboard
public static readonly DependencyProperty ModeProperty =
DependencyProperty.Register("Mode", typeof(TouchKeyboardMode), typeof(TouchKeyboard), new PropertyMetadata(TouchKeyboardMode.AlphaNumeric));
+ public KeyboardOutputMode OutputMode
+ {
+ get { return (KeyboardOutputMode)GetValue(OutputModeProperty); }
+ set { SetValue(OutputModeProperty, value); }
+ }
+ public static readonly DependencyProperty OutputModeProperty =
+ DependencyProperty.Register("OutputMode", typeof(KeyboardOutputMode), typeof(TouchKeyboard), new PropertyMetadata(KeyboardOutputMode.Wpf));
+
public KeyboardActionKeyMode ActionKeyMode
{
get { return (KeyboardActionKeyMode)GetValue(ActionKeyModeProperty); }
@@ -489,7 +497,7 @@ namespace Tango.Touch.Keyboard
}
- if (key.Length > 1 || (isSpecialChar && definition.KeysLinesDefinitions.SelectMany(x => x.KeyDefinitions).Select(x => x.StandardText).Contains(key)))
+ if (key.Length > 1 || (isSpecialChar && definition.KeysLinesDefinitions.SelectMany(x => x.KeyDefinitions).Select(x => x.StandardText).Contains(key)) || OutputMode == KeyboardOutputMode.Windows)
{
Core.Threading.ThreadFactory.StartNew(() =>
{