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
diff --git a/libs/androidfw/KeyLayoutMap.cpp b/libs/androidfw/KeyLayoutMap.cpp
index 2db19c5..ae14f23 100644
--- a/libs/androidfw/KeyLayoutMap.cpp
+++ b/libs/androidfw/KeyLayoutMap.cpp
@@ -185,8 +185,8 @@
}
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 @@
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 @@
for (;;) {
mTokenizer->skipDelimiters(WHITESPACE);
- if (mTokenizer->isEol()) {
+ if (mTokenizer->isEol() || mTokenizer->peekChar() == '#') {
break;
}
String8 keywordToken = mTokenizer->nextToken(WHITESPACE);