aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/PPC/Modules/Tango.PPC.Browser/BoundsObjects/KeyboardHandler.cs
blob: 50df8ae0c26d0e21ddfa86958af10361b74f9f3c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Tango.PPC.Browser.Attributes;
using Tango.PPC.Common.Helpers;
using Tango.Touch.Keyboard;

namespace Tango.PPC.Browser.BoundsObjects
{
    [BoundObject("keyboard", "keyboard.js")]
    public class KeyboardHandler
    {
        public void openKeyboard(String inputType)
        {
            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                switch (inputType)
                {
                    case "search":
                        KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Go);
                        break;
                    default:
                        KeyboardHelper.OpenKeyboard(KeyboardActionKeyMode.Next);
                        break;
                }
            }));
        }

        public void closeKeyboard()
        {
            Application.Current.Dispatcher.BeginInvoke(new Action(() =>
            {
                KeyboardHelper.CloseKeyboard();
            }));
        }
    }
}