如何使用sendkeys方法同时按下功能键(fn)和f11? [英] How can I press both function key (fn) and f11 at the same time using the sendkeys method?

查看:346
本文介绍了如何使用sendkeys方法同时按下功能键(fn)和f11?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

或者,怎么样,发送密钥的代码(ASCII)而不是密钥本身?





你好每个人,



如何同时按下这两个功能使用sendkeys方法同时键(fn)和f11?



我试过这样:

  var  WshShell =  new  ActiveXObject(  WScript.Shell); 
WshShell.AppActivate( this );
WshShell.SendKeys( FN {F11});





但这不行。



帮助我,



谢谢

解决方案

Sendkeys只能处理Windows已知和处理的密钥。在

大多数情况下,FN键直接处理硬件,而不是通过

o / s。



我怀疑Fn键是硬连线的,需要特殊的方法才能选择它们

up。



检查这个链接 [ ^ ]。


您不需要发送Fn;这只是笔记本电脑键盘上的硬件功能。您所需要的只是此处所述密钥的正确字符串。 [ ^ ]。


SendKey 的功能非常有限。对于完全真实的输入模拟,您需要使用P / Invoke for Windows API SendInput



什么都没有特别关于 Fn ,但它可能是非标准的(可能取决于硬件,我不确定)。被处理为 WM_KEYUP WM_KEYDOWN 作为任何其他密钥。



请理解使用键盘模拟作为一种肮脏的解决办法来获得所需的UI行为是不可接受的。它只能用于特殊的系统目的,例如创建键盘宏工具,虚拟键盘等。



-SA

Or, how about this, sending the key's code (ASCII) instead the key itself?


Hallo Everybody,

How can I press both the function key (fn) and f11 at the same time using the sendkeys method?

I tried like this:

var WshShell = new ActiveXObject("WScript.Shell");
                WshShell.AppActivate(this);
                WshShell.SendKeys("FN{F11}");



but this is not working.

Help me,

Thanks

解决方案

Sendkeys can only deal with keys known to and processed by windows. In
most cases, the FN key deals directly with the hardware, and not through the
o/s.

I suspect that Fn keys are hardwired and need special methods to pick them
up.

Check this link[^].


You don't need to send "Fn"; that is merely a hardware feature on the laptop keyboard. All you need is the correct string for the key in question as described here[^].


The functionality of SendKey is very limited. For completely authentic simulation of input you need to use P/Invoke for Windows API SendInput.

There is nothing special about Fn, but it can be non-standard (maybe depending on hardware, I'm not sure). Is is handled as WM_KEYUP, WM_KEYDOWN as any other key.

Please understand that using keyboard simulation as a dirty work-around to get desired UI behavior is unacceptable. It can be uses only for special "system" purposes, such as creation of keyboard macro tools, virtual keyboards, etc.

—SA


这篇关于如何使用sendkeys方法同时按下功能键(fn)和f11?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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