网站首页  词典首页

请输入您要查询的函数:

 

术语 setkeyboardstate
释义 SetKeyboardState
语法:
BOOL SetKeyboardState( LPBYTE lpKeyState
);
SetKeyboardState功能
该SetKeyboardState函数拷贝256字节数组的键盘关键州到调用线程的键盘输入状态表。这是同一个表的GetKeyboardState和GetKeyState函数访问。所做的更改此表不影响键盘输入任何其他线程。
参数
lpKeyState
[in]指向1 256字节数组,包含键盘的关键州。
返回值
如果函数成功,返回值为非零。
如果函数失败,返回值是零。为了获得更多错误信息,调用GetLastError。
备注
由于SetKeyboardState功能改变了调用线程的输入状态,而不是全球性的系统输入状态,应用程序无法使用SetKeyboardState设置键盘上的NUM LOCK键,CAPS LOCK键,或SCROLL LOCK键(或日语假名)指示灯。这些可以设置或清除使用SendInput模拟击键。
Windows NT/2000/XP的:在keybd_event函数也可以切换NUM LOCK键,CAPS LOCK键,和Scroll Lock键。
在Windows 95/98/Me:在keybd_event函数可以切换只CAPS LOCK和SCROLL LOCK键键。它不能切换NUM LOCK键。
功能信息
最低DLL版本 user32.dll
在Winuser.h中HeaderDeclared,头文件:winuser.h
import libraryUser32.lib
最低操作系统Windows 95,Windows NT 3.1
参见
键盘输入,GetAsyncKeyState,GetKeyboardState,GetKeyState,keybd_event,MapVirtualKey,SendInput
==英文原文==SetKeyboardState Function
The SetKeyboardState function copies a 256-byte array of keyboard key states into the calling thread's keyboard input-state table. This is the same table accessed by the GetKeyboardState and GetKeyState functions. Changes made to this table do not affect keyboard input to any other thread.
Syntax
BOOL SetKeyboardState( LPBYTE lpKeyState
);
Parameters
lpKeyState
[in] Pointer to a 256-byte array that contains keyboard key states.
Return Value
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
Remarks
Because the SetKeyboardState function alters the input state of the calling thread and not the global input state of the system, an application cannot use SetKeyboardState to set the NUM LOCK, CAPS LOCK, or SCROLL LOCK (or the Japanese KANA) indicator lights on the keyboard. These can be set or cleared using SendInput to simulate keystrokes.
Windows NT/2000/XP: The keybd_event function can also toggle the NUM LOCK, CAPS LOCK, and SCROLL LOCK keys.
Windows 95/98/Me: The keybd_event function can toggle only the CAPS LOCK and SCROLL LOCK keys. It cannot toggle the NUM LOCK key.
Function Information
Minimum DLL Versionuser32.dll
HeaderDeclared in Winuser.h, include Windows.h
Import libraryUser32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
See Also
Keyboard Input , GetAsyncKeyState , GetKeyboardState , GetKeyState , keybd_event , MapVirtualKey , SendInput
==原始网址==http://msdn.microsoft.com/en-us/library/ms646314(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 13:17:12