summaryrefslogtreecommitdiff
path: root/libs/ui/InputReader.cpp
diff options
context:
space:
mode:
author Jeff Brown <jeffbrown@google.com> 2010-10-29 22:19:53 -0700
committer Jeff Brown <jeffbrown@google.com> 2010-11-05 13:27:35 -0700
commitd4ecee931322b9832b729f2fcbaed21c35edd3bf (patch)
treec712c9351c2b4b52430d2d47c8d21d9f54a65e11 /libs/ui/InputReader.cpp
parent283397c469b306700d168ae8d22dde7758a45e48 (diff)
Rename the locked meta key constants for clarity.
Also added some tests for LED setting. Change-Id: I3fd86322afd07ae8de52d1ccbc2fae2c6d586641
Diffstat (limited to 'libs/ui/InputReader.cpp')
-rw-r--r--libs/ui/InputReader.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/ui/InputReader.cpp b/libs/ui/InputReader.cpp
index 120222c943..b91e93a47c 100644
--- a/libs/ui/InputReader.cpp
+++ b/libs/ui/InputReader.cpp
@@ -129,11 +129,11 @@ int32_t updateMetaState(int32_t keyCode, bool down, int32_t oldMetaState) {
case AKEYCODE_META_RIGHT:
return setEphemeralMetaState(AMETA_META_RIGHT_ON, down, oldMetaState);
case AKEYCODE_CAPS_LOCK:
- return toggleLockedMetaState(AMETA_CAPS_LOCK_LATCHED, down, oldMetaState);
+ return toggleLockedMetaState(AMETA_CAPS_LOCK_ON, down, oldMetaState);
case AKEYCODE_NUM_LOCK:
- return toggleLockedMetaState(AMETA_NUM_LOCK_LATCHED, down, oldMetaState);
+ return toggleLockedMetaState(AMETA_NUM_LOCK_ON, down, oldMetaState);
case AKEYCODE_SCROLL_LOCK:
- return toggleLockedMetaState(AMETA_SCROLL_LOCK_LATCHED, down, oldMetaState);
+ return toggleLockedMetaState(AMETA_SCROLL_LOCK_ON, down, oldMetaState);
default:
return oldMetaState;
}
@@ -966,8 +966,8 @@ void KeyboardInputMapper::processKey(nsecs_t when, bool down, int32_t keyCode,
// Note: getDisplayInfo is non-reentrant so we can continue holding the lock.
if (mAssociatedDisplayId >= 0) {
int32_t orientation;
- if (! getPolicy()->getDisplayInfo(mAssociatedDisplayId, NULL, NULL, & orientation)) {
- return;
+ if (!getPolicy()->getDisplayInfo(mAssociatedDisplayId, NULL, NULL, & orientation)) {
+ orientation = InputReaderPolicyInterface::ROTATION_0;
}
keyCode = rotateKeyCode(keyCode, orientation);
@@ -1058,11 +1058,11 @@ int32_t KeyboardInputMapper::getMetaState() {
void KeyboardInputMapper::updateLedStateLocked(bool reset) {
updateLedStateForModifierLocked(mLocked.capsLockLedState, LED_CAPSL,
- AMETA_CAPS_LOCK_LATCHED, reset);
+ AMETA_CAPS_LOCK_ON, reset);
updateLedStateForModifierLocked(mLocked.numLockLedState, LED_NUML,
- AMETA_NUM_LOCK_LATCHED, reset);
+ AMETA_NUM_LOCK_ON, reset);
updateLedStateForModifierLocked(mLocked.scrollLockLedState, LED_SCROLLL,
- AMETA_SCROLL_LOCK_LATCHED, reset);
+ AMETA_SCROLL_LOCK_ON, reset);
}
void KeyboardInputMapper::updateLedStateForModifierLocked(LockedState::LedState& ledState,
@@ -1228,7 +1228,7 @@ void TrackballInputMapper::sync(nsecs_t when) {
// Note: getDisplayInfo is non-reentrant so we can continue holding the lock.
int32_t orientation;
if (! getPolicy()->getDisplayInfo(mAssociatedDisplayId, NULL, NULL, & orientation)) {
- return;
+ orientation = InputReaderPolicyInterface::ROTATION_0;
}
float temp;