Repository navigation
Conversation
Every AndroidKey constant drops Android's KEYCODE_ prefix (ENTER, BACK, CUT, COPY...), except the zoom keys, which were named KEYCODE_ZOOM_IN and KEYCODE_ZOOM_OUT. AndroidKey.ZOOM_IN therefore raised AttributeError. PASTE (279) was also missing, although CUT (277) and COPY (278) were there. Add ZOOM_IN = 168, ZOOM_OUT = 169 and PASTE = 279, matching KEYCODE_ZOOM_IN, KEYCODE_ZOOM_OUT and KEYCODE_PASTE in AOSP's android.view.KeyEvent. KEYCODE_ZOOM_IN and KEYCODE_ZOOM_OUT stay as aliases so existing code keeps working. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
AndroidKeynames drop Android'sKEYCODE_prefix, such asENTER,BACK,CUTandCOPY. The two zoom keys were the only exceptions, namedKEYCODE_ZOOM_INandKEYCODE_ZOOM_OUT, so the expected name does not exist:PASTE(279) was also missing, althoughCUT(277) andCOPY(278) are there.Fix
Add
ZOOM_IN = 168,ZOOM_OUT = 169andPASTE = 279. These matchKEYCODE_ZOOM_IN,KEYCODE_ZOOM_OUTandKEYCODE_PASTEin AOSP'sandroid.view.KeyEvent.KEYCODE_ZOOM_INandKEYCODE_ZOOM_OUTstay as aliases, so existing code keeps working. Theis_*_keyhelpers compare values, not names, so the aliases don't affect them.Tests
AttributeError: type object 'AndroidKey' has no attribute 'ZOOM_IN'.ruff check,ruff format --check,mypy appiumand the full unit test suite pass.🤖 Generated with Claude Code