diff options
author | 2010-10-29 22:19:53 -0700 | |
---|---|---|
committer | 2010-11-05 13:27:35 -0700 | |
commit | 51e7fe7545e3509ebb5c31c10440acd31cec89a2 (patch) | |
tree | c9826e9555c6ec96ba3061365bcb7ed2a555c43e /libs/ui/InputReader.cpp | |
parent | 06a42367ce6b7116c451f9e3155196ef8806f861 (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.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/libs/ui/InputReader.cpp b/libs/ui/InputReader.cpp index 120222c94375..b91e93a47c41 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; |