aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs')
-rw-r--r--Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs51
1 files changed, 38 insertions, 13 deletions
diff --git a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs
index 50df8ae0c..3c608a518 100644
--- a/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs
+++ b/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs
@@ -6,6 +6,7 @@ using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Tango.PPC.Browser.Attributes;
+using Tango.PPC.Browser.Views;
using Tango.PPC.Common.Helpers;
using Tango.Touch.Keyboard;
@@ -14,28 +15,52 @@ namespace Tango.PPC.Browser.BoundsObjects
[BoundObject("keyboard", "keyboard.js")]
public class KeyboardHandler
{
+ private DateTime _lastTime;
+
+ public KeyboardHandler()
+ {
+ _lastTime = DateTime.Now;
+ }
+
public void openKeyboard(String inputType)
{
- Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+ if (DateTime.Now > _lastTime.AddMilliseconds(1000))
{
- switch (inputType)
+ _lastTime = DateTime.Now;
+
+ Application.Current.Dispatcher.BeginInvoke(new Action(async () =>
{
- case "search":
- KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Go);
- break;
- default:
- KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Next);
- break;
- }
- }));
+ switch (inputType)
+ {
+ case "search":
+ KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Go);
+ break;
+ default:
+ KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Next);
+ break;
+ }
+
+
+ await Task.Delay(50);
+ BrowserView.Instance.btnGo.Focus();
+ await Task.Delay(50);
+ BrowserView.Instance.Browser.Focus();
+ Debug.WriteLine("Focus");
+ }));
+ }
}
public void closeKeyboard()
{
- Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+ if (DateTime.Now > _lastTime.AddMilliseconds(1000))
{
- KeyboardHelper.CloseKeyboard();
- }));
+ _lastTime = DateTime.Now;
+
+ Application.Current.Dispatcher.BeginInvoke(new Action(() =>
+ {
+ KeyboardHelper.CloseKeyboard();
+ }));
+ }
}
}
}