The keybd_event function synthesizes a keystroke. The system can use such a synthesized keystroke to generate a WM_KEYUP or WM_KEYDOWN message. The keyboard driver’s interrupt handler calls the keybd_event function.
Windows NT only: This function has been superseded. Use SendInput instead.
VOID keybd_event(
BYTE bVk, |
// virtual-key code |
BYTE bScan, |
// hardware scan code |
DWORD dwFlags, |
// flags specifying various function options |
DWORD dwExtraInfo |
// additional data associated with keystroke |
); |
Value |
Meaning |
KEYEVENTF_EXTENDEDKEY |
If specified, the scan code was preceded by a prefix byte having the value 0xE0 (224). |
KEYEVENTF_KEYUP |
If specified, the key is being released. If not specified, the key is being depressed. |
This function has no return value.
Although keybd_event passes an OEM-dependent hardware scan code to Windows, applications should not use the scan code. Windows converts scan codes to virtual-key codes internally and clears the up/down bit in the scan code before passing it to applications.
An application can simulate a press of the PRINTSCREEN key in order to obtain a screen snapshot and save it to the Windows clipboard. To do this, call keybd_event with the bVk parameter set to VK_SNAPSHOT, and the bScan parameter set to 0 for a snapshot of the full screen or set bScan to 1 for a snapshot of the active window.
GetAsyncKeyState, GetKeyState, MapVirtualKey, SetKeyboardState
file: /Techref/os/win/api/win32/func/src/f52_20.htm, 4KB, , updated: 2000/4/7 11:19, local time: 2024/11/24 23:48,
18.217.161.27:LOG IN
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://sxlist.com/TECHREF/os/win/api/win32/func/src/f52_20.htm"> keybd_event</A> |
Did you find what you needed? |
Welcome to sxlist.com!sales, advertizing, & kind contributors just like you! Please don't rip/copy (here's why Copies of the site on CD are available at minimal cost. |
Welcome to sxlist.com! |
.