Question

Method SendKeys.Send does not allow the press Fn key, which exists on laptop's keyboards. How can I simulate pressing this key from C#?

Was it helpful?

Solution

You can't, and you don't need to. The Fn key only exists as a key as far as the keyboard circuit is concerned.

When the key code is sent to the operating system, it looks just as if the function keys were regular keys as on a regular keyboard. The operating system doesn't even know that the Fn key exists, that is taken care of by the special keyboard circuit in the laptop.

To make a function key press on a laptop, just send the regular key code for a function key as on a regular keyboard.

If there are any other key combinations where the Fn key is used, they either have their own key codes, or they are simply not possible to send because they are handled by the laptop, not by the operating system.

OTHER TIPS

I have never tried it, but I think you can do it with another way. Create a keydown event on a textbox and press fn key at runtime and then check what code or what keyValue it returns. Then use that value in your SendKeys.Send method.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top