我如何模拟使用C#的功能键组合? [英] How can I simulate function key combinations using C#?

查看:110
本文介绍了我如何模拟使用C#的功能键组合?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我希望有人能够帮助我模拟C#中的功能组合键,在这种情况下, FN + F4



下面是我正在做的事情......我有一台较老的触摸屏上网本,我最近安装了Windows 8。它有一个旋转屏幕,所以你可以把它折叠起来,像平板电脑一样使用它。 Windows 8运行得非常好。我有一些小问题,其中大部分是我能够解决的,但仍有一些问题。



当您首次启动上网本或将其从睡眠中唤醒时,屏幕亮度为30%,Windows认为这是最大设置,因此通过常规方法提高屏幕亮度不起作用。在我的上网本上,按 FN + F4 ,将屏幕恢复为完全亮度。这是一个小小的烦恼,因为我不得不使用物理键盘来回旋转屏幕以固定亮度,当我想将它放在平板电脑的位置并尽量减少磨损时。



我想要做的是编写一个启动时运行的应用程序,并模拟功能组合键,以便自动恢复亮度。任何建议将不胜感激。谢谢。

解决方案

Fn 键不是从键盘发送到计算机的键。它实际上用于更改键盘上按键的含义(例如,当 Fn 按下时按下该按键时,键盘会发送不同的扫描代码)。

您应该可以轻松编写一个简单的Windows Forms程序来监听按键并显示接收到的内容。注册 KeyDown 事件。您的处理程序收到的 KeyEventArgs 具有各种属性,你可以检查看看收到的是什么。


I was hoping someone could help me with simulating a function key combination 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 on. It has a swivel screen so you can fold it down and use it like a tablet. Windows 8 runs surprisingly well on it. I had a few minor issues, most of which I was able to work out, but one remains.

When you first power up the netbook or wake it from sleep, the screen is at 30% brightness, and Windows thinks that this is the max setting, so increasing the screen brightness through the normal methods does not work. On my netbook, pressing FN + F4, restores the screen to full brightness. This is a minor annoyance though, because I have to swivel the screen back and forth to fix the brightness using the physical keyboard, when I'd like to just leave it in the tablet position and minimize wear and tear.

What I'd like to do is write a little application that runs on start up, and simulates the function key combination, so the brightness is restored automatically. Any suggestions would be greatly appreciated. Thanks.

解决方案

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 keys on the keyboard (such that the keyboard sends different scancodes when the key is pressed with Fn held down).

You should be able to easily write a simple Windows Forms program that listens to key presses and shows you what has been received. Register for the KeyDown event. The KeyEventArgs your handler receives has various properties that you can inspect to see what is being received.

这篇关于我如何模拟使用C#的功能键组合?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆