如何模拟Fn +?-用于笔记本的KeyPress?或如何开启3G?

How to simulate a Fn+?-KeyPress for notebooks? OR how to switch on 3G?
2021-06-20
  •  译文(汉语)
  •  原文(英语)

笔记本中的3G模块.当我重新启动笔记本电脑时,3G模块再次关闭.我必须在每次重新启动时将其打开.

所以这就是为什么我认为我需要一个简单的软件来模拟Fn+的KeyEvent -.笔记本电脑键盘上的功能是启用或禁用3G模块.

一种选择是,我找出3G模块的硬件ID并将其激活.(显然,它在设备管理器中使用了1个网络设备和4个COM端口...)

我已经发现Google并找到了以下线程:

不幸的是,这些线程并没有给我解决方案...

现在我的问题是:哪种方法会更简单?

  • 模拟Fn-KeyPress
  • 获取硬件ID并激活它们

然后...如何以简单的方式解决该问题?

希望所提供的信息能帮助您.:)

附加信息:解决方案可能是C#,BATCH甚至是注册表"hacks".我只希望打开3G模块!


//编辑:使用硬件ID无效!重新启动后,它根本不在设备管理器中.只有在我一次激活Fn+之后,-它才会在其中列出.那么还有其他方法可以开启3G吗?

速聊1:
速聊2:
嗨,CodingBarfield!是的,这些是我已经链接到的两个线程.但是我不知道什么吗?我是否必须找出Fn +的模式?有并用第二个线程重新输入它?这可能吗?因为似乎我只能发送带有该功能的"Windows已知"键.
速聊3:
这些Fn-KeyPresses可能会跳过操作系统,并可能直接与实际硬件硬连线.但是我不这么认为,通常您需要某种驱动程序才能使实际的按钮起作用.我将研究反编译/分析笔记本电脑键盘的设备驱动程序,并查看它们的作用.启动某些程序来启动实际的硬件绝非易事.
速聊4:
哎呀,那小小的风光是很多工作...还有其他激活3G的方法吗?在制造商的软件中,有一个简单的按钮用于打开和关闭.我只需要那个功能...
速聊5:
FWIW:在我工作的一家大型计算机公司的笔记本电脑上,Fn键由单独的微处理器处理.Fn的"按键"通过ACPI进入操作系统.因此,键盘驱动程序不涉及这些按键.因此,无法以通常的方式(SendKeys()等)模拟击键.使用PnP(通过参考示例中的Setup API)或Power mgmt的方法.功能更可能起作用.我建议在Windows中查看POWERCFG.EXE实用程序.powercfg /?会给你帮助.注意-DEVICEENABLEWAKE-DEVICEDISABLEWAKE选项.
解决过程1

要模拟键盘事件,您应该能够创建一个新的键盘事件,该事件将模拟C#中的按键.例子

keybd_event( VK_NUMLOCK,0x45,KEYEVENTF_EXTENDEDKEY | 0, 0 );

3G module in a notebook. When I restart that notebook, the 3G module is turned off again. I have to turn it on on every restart.

So that's why I thought I need a simple software that simulates the KeyEvent of Fn+-. It's function on the notebook keyboard is to en- or disable th 3G-module.

An option would be that I find out the 3G module's hardware-ID and activate it. (Apparently it uses 1 network device and 4 COM-ports in the device manager...)

I already discovered Google and found these threads:

Unfortunately these threads don't give me a solution...

Now my question: What method would be more simple?

  • simulating the Fn-KeyPress
  • getting the hardware-IDs and acitvating them

And then... how to solve that problem in an easy way?

I hope the given Information will help you to help me. :)

Additional info: the solution may be in C#, BATCH or even registry "hacks". I just want that 3G module to be turned on!


//EDIT: Playing with the hardware-ID will NOT work! After a restart, it's simply not in the device manager. Only after I once activated Fn+- it's listed there. So is there any other way to just switch on 3G?

Talk2:
Hi CodingBarfield! Yes, These are the two threads I already linked to. But I cant get a clue? Do I have to find out what pattern the Fn+? has and re-input it with the second thread? Is this possible? Because it seems like I can only send "Windows-known" keys wit that function.
Talk3:
Those Fn-KeyPresses might be skipping the OS and could be hardwired directly to the actual hardware. But I don't think so, usually you need some kind of drivers for the actual buttons to work. I would look at decompiling/analysing the device drivers for the laptop keyboard and see what they do. It can't be much more the start some process to start the actual hardware.
Talk4:
Phew, that's much work for that little shizzle... Is there any other way to activate 3G? In the manufacturer's software, there's a simple button for switching on and off. I just need that functionality...
Talk5:
FWIW: on the laptops from a large computer company I work for, the Fn keys are handled by a separate micro processor. The Fn "key strokes" make their way into the OS via ACPI. So the keyboard driver is not involved in these key presses. So simulating keystrokes in the usual way (SendKeys(), etc.) won't work. An approach using PnP (via Setup APIs in the example referenced) or using Power mgmt. functionality is more likely to work. I suggest looking at the POWERCFG.EXE utility in Windows. powercfg /? will give you help. Note the -DEVICEENABLEWAKE and -DEVICEDISABLEWAKE options.
Solutions1

To simulate a keyboard event you should be able to create a new keyboard event which will simulate a keypress in C#. example

keybd_event( VK_NUMLOCK,0x45,KEYEVENTF_EXTENDEDKEY | 0, 0 );

转载于:https://stackoverflow.com/questions/18571152/how-to-simulate-a-fn-keypress-for-notebooks-or-how-to-switch-on-3g

本人是.net程序员,因为英语不行,使用工具翻译,希望对有需要的人有所帮助
如果本文质量不好,还请谅解,毕竟这些操作还是比较费时的,英语较好的可以看原文

留言回复
我们只提供高质量资源,素材,源码,坚持 下了就能用 原则,让客户花了钱觉得值
上班时间 : 周一至周五9:00-17:30 期待您的加入