aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.SharedUI/Keyboard/KeyboardDefinition.cs
blob: 65e32217c62d701bee9e489b07a5fe72bd2fda40 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
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.SharedUI.Keyboard
{
    public class KeyboardDefinition
    {
        public String Name { get; set; }

        public bool HasCaps { 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 = CreateDefault();
                }

                return _default;
            }
            set { _default = value; }
        }


        private static KeyboardDefinition CreateDefault()
        {
            KeyboardDefinition definition = new KeyboardDefinition();

            definition.Name = "English";
            definition.HasCaps = true;

            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.SpecialRightKeyDefinitions.Add(new SpecialKeyDefinition()
            {
                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",
            });

            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",
            });

            definition.KeysLinesDefinitions.Add(line1);
            definition.KeysLinesDefinitions.Add(line2);
            definition.KeysLinesDefinitions.Add(line3);

            return definition;
        }
    }
}