Edit: Split from [Solved] Macro: What key is pressed in key down event |
Edit: Split from [Solved] Macro: What key is pressed in key down event |
how to detect control key, or alt from the passed event ?
Modifiers integer 1
Modifiers integer 3
how to detect same from a control that has no input text capabilities from user ? example a label control.
UnklDonald418 wrote:arfghhow to detect same from a control that has no input text capabilities from user ? example a label control.
makes no sense. A control that has no user input capabilities will never trigger a Key pressed event.
Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
sub checkforControlkeyDown
do
If GetAsyncKeyState( &h11) Then
msgbox "ctrl pressed"
exit do
end if
loop
End Sub
JeJe wrote:I'm really not following what you want to do, but as you're on windows you can use the windows api to test whether the control key is down. Put this code in a module, run it, and press the control key. It will run forever if you don't press the control key.
- Code: Select all Expand viewCollapse view
Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
sub checkforControlkeyDown
do
If GetAsyncKeyState( &h11) Then
msgbox "ctrl pressed"
exit do
end if
loop
End Sub
we have an image control and we want to maximize it when move the mouse over it, but only when we have control key pressed
REM use AND to also capture Ctrl key modifier combinations
if (oEv.Modifiers AND com.sun.star.awt.KeyModifier.MOD1) = 0 then
exit sub
end if
Villeroy wrote:Since 6 years we write all the macros for this idiot. He does not understand any hints until you explicitly tell him what to do exactly.
Users browsing this forum: No registered users and 7 guests