Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1485)

Unified Diff: ui/keyboard/resources/elements/kb-keyboard.html

Issue 23621045: Layout transitions triggered on key-down instead of key-up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed nits. Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/keyboard/resources/elements/kb-key.html ('k') | ui/keyboard/resources/layouts/dvorak.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/keyboard/resources/elements/kb-keyboard.html
diff --git a/ui/keyboard/resources/elements/kb-keyboard.html b/ui/keyboard/resources/elements/kb-keyboard.html
index 8c4f45488009d27e46787be45c078a6414e15282..4fa7b15027c0a3c2742d35bf6023fe261d5da8b3 100644
--- a/ui/keyboard/resources/elements/kb-keyboard.html
+++ b/ui/keyboard/resources/elements/kb-keyboard.html
@@ -289,6 +289,20 @@
this.lastPressedKey = event.target;
this.lastPressedKey.classList.add('active');
repeatKey.cancel();
+
+ var char = detail.char;
+ switch(char) {
+ case 'Shift':
+ // Removes caps-lock if caps-locked.
+ if(this.classList.contains('caps-locked')) {
+ this.classList.remove('caps-locked');
+ }
+ break;
+ default:
+ break;
+ }
+
+ // A transition key was pressed, immediately move to new keyset.
var toKeyset = detail.toKeyset;
if (toKeyset) {
this.keyset = toKeyset;
@@ -400,7 +414,8 @@
return;
}
var toKeysetId = detail.toKeyset;
- // Keyset transition key.
+ // Keyset transition key. This is needed to transition from upper
+ // to lower case when we are not in caps mode.
if (toKeysetId) {
this.keyset = toKeysetId;
this.querySelector('#' + this.layout + '-' + this.keyset).nextKeyset =
@@ -422,9 +437,6 @@
return;
case 'Shift':
swipeStatus.swipeFlags = 0;
- // We have reverted to lower case.
- if(this.classList.contains('caps-locked'))
- this.classList.remove('caps-locked');
return;
case 'Microphone':
this.voiceInput_.onDown();
« no previous file with comments | « ui/keyboard/resources/elements/kb-key.html ('k') | ui/keyboard/resources/layouts/dvorak.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698