Eso amigos.
Necesito emular (via codigo) presionar las teclas CONTROL + CLICK IZQ del mouse.
Es para lanzar una acción sin tener teclado ni mouse, en una pantalla touch.
Agradeceré cualquier codigo de muestra, o sugerencias.
Saludos.
FUNCTION Teclado( oDlg, nKey, nVeces )
LOCAL nVez
DEFAULT nVeces := 1
oDlg:SetFocus( )
FOR nVez := 1 TO nVeces
oDlg:POSTMSG( WM_KEYDOWN, nKey, 0 )
NEXT
RETURN ( NIL )
#Include "FiveWin.Ch"
Function Main()
LOCAL oWnd
DEFINE WINDOW oWnd TITLE "Testando Teclado"
oWnd:bKeyDown := { | nKey | StdKey( nKey ) }
oWnd:bKeyChar := { | nKey | StdKey( nKey ) }
ACTIVATE WINDOW oWnd
Return Nil
FUNCTION StdKey( nKey )
do case
case nKey == 1 .and. GetKeyState( VK_CONTROL )
? Str( nKey )
case nKey == 2 .and. GetKeyState( VK_CONTROL )
? Str( nKey )
case nKey == 3 .and. GetKeyState( VK_CONTROL )
? Str( nKey )
case nKey == 4 .and. GetKeyState( VK_CONTROL )
? Str( nKey )
case nKey == 8 .and. GetKeyState( VK_CONTROL )
? Str( nKey )
case nKey == 13 .and. GetKeyState( VK_CONTROL )
? Str( nKey )
case nKey == 65 .and. GetKeyState( VK_CONTROL ) // Crtl + A
? Str( nKey )
case nKey == 66 .and. GetKeyState( VK_CONTROL ) // Crtl + B
? Str( nKey )
case nKey == 68 .and. GetKeyState( VK_CONTROL ) // Crtl + C
? Str( nKey )
case nKey == 38 .and. GetKeyState( VK_CONTROL ) // Ctrl + Down
? Str( nKey )
case nKey == 40 .and. GetKeyState( VK_CONTROL ) // Ctrl + Up
? Str( nKey )
case nKey == 48 .and. GetKeyState( VK_CONTROL ) // Ctrl + 0
? Str( nKey )
end case
RETURN Nil
Teclado( oDlg, .T., VK_CONTROL, nVeces )
Teclado( oDlg, .F., VK_CONTROL, nVeces )
//---------------------------------------//
FUNCTION Teclado( oWind, lPressed, nVKey, nVeces )
LOCAL nVez, nTecla
DEFAULT nVeces := 1
nTecla := if(lPressed, WM_KEYDOWN, WM_KEYUP)
oWind:SetFocus( )
FOR nVez := 1 TO nVeces
oWind:PostMsg( nTecla, nVKey, 0 )
NEXT
RETURN ( NIL )
Return to FiveWin para Harbour/xHarbour
Users browsing this forum: No registered users and 62 guests