1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved.
2 // limitations under the License.
3 // See the License for the specific language governing permissions and
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
5 // distributed under the License is distributed on an "AS-IS" BASIS,
6 // Unless required by applicable law or agreed to in writing, software
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // You may obtain a copy of the License at
11 // you may not use this file except in compliance with the License.
12 // Licensed under the Apache License, Version 2.0 (the "License");
14 goog.provide('i18n.input.chrome.inputview.layouts.RowsOf102');
16 goog.require('i18n.input.chrome.inputview.layouts.util');
20 * Creates the top four rows for 102 keyboard.
22 * @return {!Array.<!Object>} The rows.
24 i18n.input.chrome.inputview.layouts.RowsOf102.create = function() {
31 var backquoteKey = i18n.input.chrome.inputview.layouts.util.createKey({
34 var keySequenceOf12 = i18n.input.chrome.inputview.layouts.util.
35 createKeySequence(baseKeySpec, 12);
36 var backspaceKey = i18n.input.chrome.inputview.layouts.util.createKey({
39 var row1 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
41 'children': [backquoteKey, keySequenceOf12, backspaceKey]
47 // First linear layout at the left of the enter.
48 var tabKey = i18n.input.chrome.inputview.layouts.util.createKey({
51 keySequenceOf12 = i18n.input.chrome.inputview.layouts.util.
52 createKeySequence(baseKeySpec, 12);
53 var row2 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
55 'children': [tabKey, keySequenceOf12]
58 // Second linear layout at the right of the enter.
59 var capslockKey = i18n.input.chrome.inputview.layouts.util.createKey({
62 keySequenceOf12 = i18n.input.chrome.inputview.layouts.util.createKeySequence({
65 var row3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
67 'children': [capslockKey, keySequenceOf12]
70 // Vertical layout contains the two rows at the left of the enter.
71 var vLayout = i18n.input.chrome.inputview.layouts.util.createVerticalLayout({
73 'children': [row2, row3]
76 // Vertical layout contains enter key.
77 var enterKey = i18n.input.chrome.inputview.layouts.util.createKey({
78 'widthInWeight': 0.98,
81 var enterLayout = i18n.input.chrome.inputview.layouts.util.
82 createVerticalLayout({
84 'children': [enterKey]
87 // Linear layout contains the two vertical layout.
88 var row2and3 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
90 'children': [vLayout, enterLayout]
94 var shiftLeft = i18n.input.chrome.inputview.layouts.util.createKey({
97 var keySequenceOf11 = i18n.input.chrome.inputview.layouts.util.
98 createKeySequence(baseKeySpec, 11);
99 var shiftRight = i18n.input.chrome.inputview.layouts.util.createKey({
100 'widthInWeight': 2.16
102 var row4 = i18n.input.chrome.inputview.layouts.util.createLinearLayout({
104 'children': [shiftLeft, keySequenceOf11, shiftRight]
107 return [row1, row2and3, row4];