0

I'm tring to simulate pressing the commend FN+DELETE using Selenium and Typescript. But seems like FN doesn't exist in .sendKeys(Key.FN) this.driver.actions().keyDown(Key.FN).sendKeys(Key.DELETE).keyUp(Key.FN).perform();

I saw a couple similar questions, but still couldn't find the right unswer (for example How to press the Fn + function keys on Windows?)

Alex
  • 21
  • 2
  • And what is Fn+Delete supposed to do? – Robby Cornelissen Jan 31 '23 at 01:08
  • @RobbyCornelissen thanks for the question! "FN + Delete", also known as the "Forward Delete" function or "Delete Forward", is a keyboard shortcut that allows a user to delete characters to the right of the cursor. Unlike the regular "Delete" key, which deletes characters to the left of the cursor, the "Forward Delete" key removes characters to the right of the cursor. – Alex Jan 31 '23 at 01:40
  • 2
    The regular [delete key](https://en.wikipedia.org/wiki/Delete_key) removes characters to the right of the cursor. Backspace removes characters to the left of the cursor. – Robby Cornelissen Jan 31 '23 at 01:46
  • Thank you so much @RobbyCornelissen! That is exactly what I needed! Do you know by any chance the answer to [this question](https://stackoverflow.com/questions/72504048/selenium-doesnt-navigate-text-with-shortcuts-like-cmdup-or-altup)? – Alex Jan 31 '23 at 04:57

1 Answers1

0

That would be possible using pyautogui with windows I think. But that isn't really consistent.

I'd rather recommend you to use right-arrow and then backspace instead, I think that should have the same effect in the end.

kaliiiiiiiii
  • 925
  • 1
  • 2
  • 21