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

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: Minor style fixes. 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
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..f4c1303aeb7f9cb42ad47378c646bf35c96ab18d 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;
@@ -422,9 +436,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();
@@ -458,7 +469,6 @@
this.keyset = toKeyset;
this.querySelector('#' + this.layout + '-' + this.keyset).nextKeyset =
detail.nextKeyset;
bshe 2013/09/16 17:52:01 nit: accidentally removed the empty line?
rsadam 2013/09/16 18:23:49 Done.
-
// Locks the keyset before removing active to prevent flicker.
this.classList.add('caps-locked');
// Makes last pressed key inactive if transit to a new keyset on long

Powered by Google App Engine
This is Rietveld 408576698