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');
18 goog.scope(function() {
19 var layouts = i18n.input.chrome.inputview.layouts;
20 var util = layouts.util;
24 * Creates the top four rows for 102 keyboard.
26 * @return {!Array.<!Object>} The rows.
28 layouts.RowsOf102.create = function() {
35 var keySequenceOf13 = util.createKeySequence(baseKeySpec, 13);
36 var backspaceKey = util.createKey({
39 var row1 = util.createLinearLayout({
41 'children': [keySequenceOf13, backspaceKey]
47 // First linear layout at the left of the enter.
48 var tabKey = util.createKey({
51 var keySequenceOf12 = util.createKeySequence(baseKeySpec, 12);
52 var row2 = util.createLinearLayout({
54 'children': [tabKey, keySequenceOf12]
57 // Second linear layout at the right of the enter.
58 var capslockKey = util.createKey({
61 keySequenceOf12 = util.createKeySequence({
64 var row3 = util.createLinearLayout({
66 'children': [capslockKey, keySequenceOf12]
69 // Vertical layout contains the two rows at the left of the enter.
70 var vLayout = util.createVerticalLayout({
72 'children': [row2, row3]
75 // Vertical layout contains enter key.
76 var enterKey = util.createKey({
77 'widthInWeight': 1.04,
80 var enterLayout = util.
81 createVerticalLayout({
83 'children': [enterKey]
86 // Linear layout contains the two vertical layout.
87 var row2and3 = util.createLinearLayout({
89 'children': [vLayout, enterLayout]
93 var shiftLeft = util.createKey({
96 var keySequenceOf11 = util.createKeySequence(baseKeySpec, 11);
97 var shiftRight = util.createKey({
100 var row4 = util.createLinearLayout({
102 'children': [shiftLeft, keySequenceOf11, shiftRight]
105 return [row1, row2and3, row4];