press_keyboard_shortcut method

Future<Online> press_keyboard_shortcut(
  1. Key key, {
  2. List<Key> modifiers = const [],
})

Implementation

Future<Online> press_keyboard_shortcut(Key key,
    {List<Key> modifiers = const []}) async {
  var keys = modifiers.map((e) => e.toString()).join('+');
  Show.action('pressing', '$keys+$key');
  await (await page).keyboard.down(key);
  for (var modifier in modifiers) {
    await (await page).keyboard.down(modifier);
  }
  await (await page).keyboard.press(key);
  for (var modifier in modifiers) {
    await (await page).keyboard.up(modifier);
  }
  await (await page).keyboard.up(key);
  return this;
}