From 8bca94ad83f82682bc15df29dc25377fe43da17f Mon Sep 17 00:00:00 2001 From: Jeff Brown Date: Mon, 23 Apr 2012 16:12:32 -0700 Subject: 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 --- libs/androidfw/KeyLayoutMap.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libs/androidfw/KeyLayoutMap.cpp') 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); -- cgit v1.2.3-59-g8ed1b