summaryrefslogtreecommitdiff
path: root/libs/androidfw/KeyLayoutMap.cpp
diff options
context:
space:
mode:
authorJeff Brown <jeffbrown@google.com>2012-04-23 16:12:32 -0700
committerJeff Brown <jeffbrown@google.com>2012-04-23 16:12:32 -0700
commit8bca94ad83f82682bc15df29dc25377fe43da17f (patch)
tree04e78f028b7a6b8c8a9e9e66d0aa4d22ed97f073 /libs/androidfw/KeyLayoutMap.cpp
parentfd6a5245ccb0294dada070444d9d9c6be752e668 (diff)
More work on international keyboards.
Changed the English US keymaps to implement a strict US key map with no additional ALT functions. Fixed a bug copying the alias in the InputDevice copy constructor. Added support for end of line comments in KCM and KL files. Added the German keyboard layout. Sorted the keys in the keyboard layout files by physical arrangement to make it easier to maintain them. Bug: 6110399 Change-Id: If44d83de5b98f2bf0016cbb8e12264387b286aaa
Diffstat (limited to 'libs/androidfw/KeyLayoutMap.cpp')
-rw-r--r--libs/androidfw/KeyLayoutMap.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/libs/androidfw/KeyLayoutMap.cpp b/libs/androidfw/KeyLayoutMap.cpp
index 2db19c5ff72f..ae14f2308645 100644
--- a/libs/androidfw/KeyLayoutMap.cpp
+++ b/libs/androidfw/KeyLayoutMap.cpp
@@ -185,8 +185,8 @@ status_t KeyLayoutMap::Parser::parse() {
}
mTokenizer->skipDelimiters(WHITESPACE);
- if (!mTokenizer->isEol()) {
- ALOGE("%s: Expected end of line, got '%s'.",
+ if (!mTokenizer->isEol() && mTokenizer->peekChar() != '#') {
+ ALOGE("%s: Expected end of line or trailing comment, got '%s'.",
mTokenizer->getLocation().string(),
mTokenizer->peekRemainderOfLine().string());
return BAD_VALUE;
@@ -234,7 +234,7 @@ status_t KeyLayoutMap::Parser::parseKey() {
uint32_t flags = 0;
for (;;) {
mTokenizer->skipDelimiters(WHITESPACE);
- if (mTokenizer->isEol()) break;
+ if (mTokenizer->isEol() || mTokenizer->peekChar() == '#') break;
String8 flagToken = mTokenizer->nextToken(WHITESPACE);
uint32_t flag = getKeyFlagByLabel(flagToken.string());
@@ -332,7 +332,7 @@ status_t KeyLayoutMap::Parser::parseAxis() {
for (;;) {
mTokenizer->skipDelimiters(WHITESPACE);
- if (mTokenizer->isEol()) {
+ if (mTokenizer->isEol() || mTokenizer->peekChar() == '#') {
break;
}
String8 keywordToken = mTokenizer->nextToken(WHITESPACE);