aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Keyboard
diff options
context:
space:
mode:
authorMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
committerMirta <mirta@twine-s.com>2020-12-30 16:39:52 +0200
commit00a491d93733d4625ad329b2ba8237f445364b3f (patch)
tree4b24c6fa78d7648f4bb7cefafa464bb0b063fec4 /Software/Visual_Studio/Tango.Touch/Keyboard
parent124ad4150f80c6846fdee41dbbda9848c105f6e5 (diff)
downloadTango-00a491d9.tar.gz
Tango-00a491d9.zip
merge
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.cs56
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml2
-rw-r--r--Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs16
4 files changed, 15 insertions, 73 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardOutputMode.cs b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardOutputMode.cs
deleted file mode 100644
index 978ae61ca..000000000
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardOutputMode.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-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 3f9106089..786a1799a 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.cs
@@ -26,8 +26,6 @@ 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>();
@@ -45,19 +43,6 @@ 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); }
@@ -74,14 +59,6 @@ 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
@@ -135,30 +112,21 @@ namespace Tango.Touch.Keyboard
{
if (!IsOpened)
{
- if (OutputMode == KeyboardOutputMode.Wpf)
+ if (GetContainer(_lastFocusedElement) != null)
{
- if (GetContainer(_lastFocusedElement) != null)
- {
- var scrollViewers = this.FindVisualChildren<LightTouchScrollViewer>().ToList();
+ 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());
}
}
@@ -350,7 +318,7 @@ namespace Tango.Touch.Keyboard
private void OnMouseDown(object sender, MouseOrTouchEventArgs e)
{
- if (e.OriginalSource.GetType().Name != "TextBoxView" && e.Source == _content_presenter && IsOpened && OutputMode == KeyboardOutputMode.Wpf)
+ if (e.OriginalSource.GetType().Name != "TextBoxView" && e.Source == _content_presenter && IsOpened)
{
IsOpened = false;
}
diff --git a/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml b/Software/Visual_Studio/Tango.Touch/Keyboard/KeyboardView.xaml
index 8458b4cab..328820913 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" OutputMode="{TemplateBinding OutputMode}"></local:TouchKeyboard>
+ <local:TouchKeyboard x:Name="PART_Keyboard"></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 9a6b7227f..1856fd2ac 100644
--- a/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
+++ b/Software/Visual_Studio/Tango.Touch/Keyboard/TouchKeyboard.cs
@@ -67,14 +67,6 @@ 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); }
@@ -497,7 +489,7 @@ namespace Tango.Touch.Keyboard
}
- if (key.Length > 1 || (isSpecialChar && definition.KeysLinesDefinitions.SelectMany(x => x.KeyDefinitions).Select(x => x.StandardText).Contains(key)) || OutputMode == KeyboardOutputMode.Windows)
+ if (key.Length > 1 || (isSpecialChar && definition.KeysLinesDefinitions.SelectMany(x => x.KeyDefinitions).Select(x => x.StandardText).Contains(key)))
{
Core.Threading.ThreadFactory.StartNew(() =>
{
@@ -505,13 +497,9 @@ namespace Tango.Touch.Keyboard
{
Forms.SendKeys.SendWait(key);
}
- else if (key != " ")
- {
- Forms.SendKeys.SendWait("{" + key + "}");
- }
else
{
- Forms.SendKeys.SendWait(" ");
+ Forms.SendKeys.SendWait("{" + key + "}");
}
Forms.SendKeys.Flush();