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

Unified Diff: chrome/browser/resources/keyboard/main.js

Issue 7074008: initial version of auto VK switching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: demo update Created 9 years, 6 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 | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/resources/keyboard/manifest.json » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/keyboard/main.js
diff --git a/chrome/browser/resources/keyboard/main.js b/chrome/browser/resources/keyboard/main.js
index 4560e9fed3511eab3addbe3fc4e19719cb1cda0c..1f7e5d5b9903a37d8db2771534a0b6590a699f62 100644
--- a/chrome/browser/resources/keyboard/main.js
+++ b/chrome/browser/resources/keyboard/main.js
@@ -559,7 +559,7 @@ var KEYS = [
// TODO(bryeung): the spacebar needs to be a little bit more stretchy,
// since this row has only 7 keys (as opposed to 12), the truncation
// can cause it to not be wide enough.
- new SpecialKey(4.8, ' ', 'Spacebar'),
+ new SpecialKey(4.8, 'US', 'Spacebar'),
new SpecialKey(1.3, ',', ','),
new SpecialKey(1.3, '.', '.'),
new HideKeyboardKey()
@@ -698,3 +698,15 @@ window.onload = function() {
}
// TODO(bryeung): would be nice to leave less gutter (without causing
// rendering issues with floated divs wrapping at some sizes).
+
+/**
+ * Switch the keyboard layout e.g. to US-Dvorak.
+ * @return {void}
+ */
+window.onhashchange = function() {
+ var layout = location.hash.replace(/^#/, "").toUpperCase();
+ MODES.forEach(function(e) {
+ allRows[3].keys_[3].modeElements_[e].textContent = layout;
+ });
+ // TODO(mazda): Switch the keyboard layout using the layout value.
+}
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | chrome/browser/resources/keyboard/manifest.json » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698