OLD | NEW |
1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. | 1 // Copyright 2014 The ChromeOS IME Authors. All Rights Reserved. |
2 // limitations under the License. | 2 // limitations under the License. |
3 // See the License for the specific language governing permissions and | 3 // See the License for the specific language governing permissions and |
4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | 4 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
5 // distributed under the License is distributed on an "AS-IS" BASIS, | 5 // distributed under the License is distributed on an "AS-IS" BASIS, |
6 // Unless required by applicable law or agreed to in writing, software | 6 // Unless required by applicable law or agreed to in writing, software |
7 // | 7 // |
8 // http://www.apache.org/licenses/LICENSE-2.0 | 8 // http://www.apache.org/licenses/LICENSE-2.0 |
9 // | 9 // |
10 // You may obtain a copy of the License at | 10 // You may obtain a copy of the License at |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 }; | 275 }; |
276 | 276 |
277 | 277 |
278 /** | 278 /** |
279 * Whether this is a letter key. | 279 * Whether this is a letter key. |
280 * | 280 * |
281 * @param {!Array.<string>} characters The characters. | 281 * @param {!Array.<string>} characters The characters. |
282 * @return {boolean} True if this is a letter key. | 282 * @return {boolean} True if this is a letter key. |
283 */ | 283 */ |
284 util.isLetterKey = function(characters) { | 284 util.isLetterKey = function(characters) { |
| 285 if (characters[0] == characters[1]) { |
| 286 return false; |
| 287 } |
| 288 |
285 if (characters[1] == util.toUpper( | 289 if (characters[1] == util.toUpper( |
286 characters[0]) || characters[1] == util. | 290 characters[0]) || characters[1] == util. |
287 toLower(characters[0])) { | 291 toLower(characters[0])) { |
288 return true; | 292 return true; |
289 } | 293 } |
290 return false; | 294 return false; |
291 }; | 295 }; |
292 | 296 |
293 | 297 |
294 /** | 298 /** |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 * @param {string} oldContext The old context. | 385 * @param {string} oldContext The old context. |
382 * @param {string} newContext The new context. | 386 * @param {string} newContext The new context. |
383 * | 387 * |
384 * @return {boolean} Whether the transform is valid. | 388 * @return {boolean} Whether the transform is valid. |
385 */ | 389 */ |
386 util.isLetterRestore = function(oldContext, newContext) { | 390 util.isLetterRestore = function(oldContext, newContext) { |
387 return util.isLetterDelete(newContext, oldContext); | 391 return util.isLetterDelete(newContext, oldContext); |
388 }; | 392 }; |
389 | 393 |
390 }); // goog.scope | 394 }); // goog.scope |
OLD | NEW |