appium / appium-mac2-driver

Next-gen Appium macOS driver, backed by Apple XCTest
Apache License 2.0
115 stars 24 forks source link

Сan't simulate pressing a shortcut #199

Open KaterinaNavara opened 1 year ago

KaterinaNavara commented 1 year ago

I'm trying to simulate pressing the shortcut - command+shift+g in the file save window, but it doesn't work either way. I tried way mentioned in documentation, like this: await browser.executeScript("macos: keys", [{ keys: [{ key: "g", modifierFlags: ((1 << 4) & (1 << 1)) }] } ]) but it doesn't work. Could you help me with it, please?

HaoWShi commented 4 months ago

has you sloved it now?I have same question about simulate combine multi keys

mykola-mokhnach commented 4 months ago

Change the expression for modifierFlags to (1 << 4) | (1 << 1)

HaoWShi commented 4 months ago

image