Platforms to show: All Mac Windows Linux Cross-Platform

Back to WindowsKeyFilterMBS class.

WindowsKeyFilterMBS.KeyDown(vkCode as Integer, scanCode as Integer, flags as Integer, time as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Windows MBS Win Plugin 10.2 ❌ No ✅ Yes ❌ No ❌ No
The key down event.

vkCode: Specifies a virtual-key code. The code must be a value in the range 1 to 254.
scanCode: Specifies a hardware scan code for the key.
flags: Specifies the extended-key flag, event-injected flag, context code, and transition-state flag. This member is specified as follows.
time: Specifies the time stamp for this message.

the flag bits are like this:
bit 0: Specifies whether the key is an extended key, such as a function key or a key on the numeric keypad. The value is 1 if the key is an extended key; otherwise, it is 0.
bit 4: Specifies whether the event was injected. The value is 1 if the event was injected; otherwise, it is 0.
bit 5: Specifies the context code. The value is 1 if the ALT key is pressed; otherwise, it is 0.
bit 7: Specifies the transition state. The value is 0 if the key is pressed and 1 if it is being released.
Other bits are reserved.

There can be only one WindowsKeyFilterMBS object in your application which receives this events.

We have currently no idea in what context this event is received. And you should return as soon as possible as this event may be called a lot of times and can block user input.

Return true if you handled the key and false if you did not handle it.
Please have this event being as fast as possible. Do not put msgbox there. Better detect a key shortcut and launch a timer to perform the action a millisecond later, so you don't block the keyboard event system.
Blocks only KeyUp or only KeyDown can lead to trouble if the internal counters for special keys get our of sync.

WindowsKeyFilterMBS.KeyUp(vkCode as Integer, scanCode as Integer, flags as Integer, time as Integer) as Boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
event Windows MBS Win Plugin 10.2 ❌ No ✅ Yes ❌ No ❌ No
The key up event.

vkCode: Specifies a virtual-key code. The code must be a value in the range 1 to 254.
scanCode: Specifies a hardware scan code for the key.
flags: Specifies the extended-key flag, event-injected flag, context code, and transition-state flag. This member is specified as follows.
time: Specifies the time stamp for this message.

the flag bits are like this:
bit 0: Specifies whether the key is an extended key, such as a function key or a key on the numeric keypad. The value is 1 if the key is an extended key; otherwise, it is 0.
bit 4: Specifies whether the event was injected. The value is 1 if the event was injected; otherwise, it is 0.
bit 5: Specifies the context code. The value is 1 if the ALT key is pressed; otherwise, it is 0.
bit 7: Specifies the transition state. The value is 0 if the key is pressed and 1 if it is being released.
Other bits are reserved.

There can be only one WindowsKeyFilterMBS object in your application which receives this events.

We have currently no idea in what context this event is received. And you should return as soon as possible as this event may be called a lot of times and can block user input.

Return true if you handled the key and false if you did not handle it.
Please have this event being as fast as possible. Do not put msgbox there. Better detect a key shortcut and launch a timer to perform the action a millisecond later, so you don't block the keyboard event system.
Blocks only KeyUp or only KeyDown can lead to trouble if the internal counters for special keys get our of sync.

The items on this page are in the following plugins: MBS Win Plugin.


The biggest plugin in space...