How can I simulate function key combinations using C #?

I was hoping someone could help me simulate a combination of function keys in C #, in this case FN + F4 .

Here's what I'm trying to do ... I have an older touchscreen netbook that I recently installed Windows 8. It has a swivel screen, so you can fold it and use it as a tablet. Windows 8 works surprisingly well. I had a few minor problems, most of which I was able to work out, but one remains.

When you first turn on the power of the netbook or wake it from sleep, the screen will have a brightness of 30%, and Windows will think that this is the maximum setting, so increasing the brightness of the screen using conventional methods does not work. On my netbook, press FN + F4 to restore screen brightness. However, this is a minor annoyance, because I have to turn the screen back and forth to fix the brightness using the physical keyboard, when I would just like to leave it in the tablet position and minimize wear.

What I would like to do is write a small application that starts when it starts up and simulates a combination of function keys, so brightness is restored automatically. Any suggestions would be appreciated. Thanks.

+4
source share
2 answers

The Fn key is not a key that is sent from the keyboard to the computer. It is actually used to change the meaning of the keys on the keyboard (so that the keyboard sends different scancodes when the key is pressed while the Fn key is pressed).

You should be able to easily write a simple Windows Forms program that listens for keystrokes and shows you what was received. Register for the KeyDown . The KeyEventArgs that your handler receives has various properties that you can check to see what will be received.

+4
source

The FN key is not a real keyboard key, like other modifiers ( shift , alt , ctrl ), and it is not a function key, like F1 - F12 . The FN key is just a hardware key that simply tells the machine to send another keystroke when you press the FN key.

So, you will have to adjust the brightness manually, like "my", indicated in the comments or through some other mechanism.

Link Link.

+2
source

All Articles