DirectTransition3D Xtra Set I
DirectTransition3D Xtra Set II
DirectTransition3D Xtra Set III
Special Discounted Bundles
How To Order
Check for Upgrades
Change Your Profile
dosKeyPress(integer keyCode, integer KeyState)
Synthesizes a keystroke on the active window. Applications can use such a synthesized keystroke to generate key down and key up events. To direct a keystroke to a specific window, first set it to the active window using the dosSetFrontWindow() function.
keyCode : An integer specifying the
virtual key code of the key
to depress or release. Please refer to
dosGetKeyState() function for possible values. On MacOS
the specified key can not be Control, Alt, Shift,
Caps Lock or the Command
Key. These modifier keys can be Synthesized on MacOS classic using the
KeyState parameter. On Windows and MacOS X, the specified key can be any key.
2 - Control
For example, to synthesize Control + Alt + 7 keystroke, call:
dosKeyPress (55, 1+2+4)
If this parameter is used to depress one or more of the above modifier keys, the function will also release the modifier key(s) after depressing the key specified by keyCode. If Caps Lock is specified in this parameter, the function will generate the key while the Caps Lock key is toggled on, then set the Caps Lock key back to its original state. The key specified by the keyCode parameter will not be released. Applications can release it by calling this function again with the KeyState parameter sets to zero.
Return Value : An integer indicating whether the method was successful or not. If 1 is returned, the method was successful. If 0 is returned, the method was not successful in which case dosGetLastError() should be called to determine the cause of the error.
The behavior of this function slightly differ on MacOS classic.
On Windows and MacOS X, the function generates a keystroke as if the physical keyboard key was actually pressed. For example, setting the keyCode parameter to 20 and the keyState parameter to 1 will actually toggle the Caps Lock key and change the status of the Caps Lock key led. As a result, after the function depresses a key, dosGetKeyState() will report that the key is pressed (even though physically it is not) until the user physically releases the key or the function is called again to release the key.
On MacOS classic, the function sends a key down or key up event to the active application. It does not change the status of the physical keyboard keys and therefore after the function depresses a key, dosGetKeyState() will not report that the synthesized keys are pressed unless they are physically pressed by the user.
P.O Box 2645, Menlo Park, CA, 94026, U.S.A
Voice: +1-415-5058249, Fax: +1-801-8585841
Toll Free: 1-800-4453093
E-mail General Information: email@example.com
E-mail Technical Support: firstname.lastname@example.org
Copyright © 1996-2004 DirectXtras Inc. All Rights Reserved.