Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard metastates #1075

Open
dashedman opened this issue Dec 14, 2024 · 1 comment
Open

Keyboard metastates #1075

dashedman opened this issue Dec 14, 2024 · 1 comment
Labels

Comments

@dashedman
Copy link

Is there some enum for keyboards metastates?

From this https://developer.android.com/reference/android/view/KeyEvent#META_SHIFT_ON

Just like AndroidKey in https://github.com/appium/python-client/blob/master/appium/webdriver/extensions/android/nativekey.py

@KazuCocoa
Copy link
Member

No, we haven't defined them.
https://github.com/appium/appium-uiautomator2-driver?tab=readme-ov-file#mobile-presskey

def press_keycode(self, keycode: int, metastate: Optional[int] = None, flags: Optional[int] = None) -> Self:

# metastate is META_SHIFT_ON and META_NUM_LOCK_ON
# flags is CANCELFLAG_CANCELEDED, FLAG_KEEP_TOUCH_MODE, FLAG_FROM_SYSTEM
assert isinstance(
driver.press_keycode(86, metastate=0x00000001 | 0x00200000, flags=0x20 | 0x00000004 | 0x00000008),
WebDriver,
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants