OnKeyUp Method of the IInputEvents Interface
It delivers to the client the key code, repeat count, and modification keys used. With the help of this method it is possible to cancel the operation.
HRESULT OnKeyUp( int KeyCode, int Count, int Flags, VARIANT_BOOL* Cancel );
void OnKeyUp( int KeyCode, int Count, int Flags, out bool Cancel );
Visual Basic .NET
Sub OnKeyUp( _ KeyCode As Integer, _ Count As Integer, _ Flags As Integer, _ ByRef Cancel As Boolean _ )
- [in] Specifies the keyboard code of the key which is released.
- [in] Contains the repeat count, the number of times the keystroke is repeated when user holds down the key.
- [in] Contains the scan code, key-transition code, previous key state, and context code, as shown in the following list:
|0-7||Specifies the scan code. The value depends on the original equipment manufacturer (OEM).|
|8||Specifies whether the key is an extended key, such as the right-hand ALT and CTRL keys that appear on an enhanced 101- or 102-key keyboard. The value is 1 if it is an extended key; otherwise, it is 0.|
|9-12||Used internally by Windows.|
|13||Specifies the context code. The value is 1 if the ALT key is held down while the key is pressed; otherwise, the value is 0.|
|14||Specifies the previous key state. The value is 1 if the key is down before the message is sent, or it is 0 if the key is up.|
|15||Specifies the transition state. The value is 1 if the key is being released, or it is 0 if the key is being pressed.|
- [out] You may set this variable to TRUE to indicate that the process should be terminated. In this case, the corresponding function returns E_ABORT.
[C++ only] If this method returns a value other than S_OK, it indicates that an error occurred on the client-side, and in this case the value of the Cancel parameter is not taken into account.
The client implementation of this method must assure that all exceptions thrown inside the method are caught and handled and no exceptions are propagated outside the method. Propagation of an exception outside the method may lead to unpredictable results (such as program termination).