Page 1 of 1

como invocar el metodo "KEYDOWN" en un txbrowse

PostPosted: Fri Jan 27, 2006 2:11 pm
by armandini
Estando en un txbrowse necesito conocer la pulsacion de una tecla de funcion "F1, F2,......F12" , el "Enter" etc.

Como puedo realizarlo ?????
Encontre los metodos KEYDOWN Y KEYCHAR pero no se como invocarlo.

Alguien puede ayudarme ???

Mil gracias.

Re: como invocar el metodo "KEYDOWN" en un txbrows

PostPosted: Fri Jan 27, 2006 2:13 pm
by VeRCE
armandini wrote:Estando en un txbrowse necesito conocer la pulsacion de una tecla de funcion "F1, F2,......F12" , el "Enter" etc.
Como puedo realizarlo ?????
Encontre los metodos KEYDOWN Y KEYCHAR pero no se como invocarlo.
Alguien puede ayudarme ???
Mil gracias.


De la misma forma que cualquier otro browse.

oTXbrowse:bKeyDown := {|| Mifuncion() }

Saludos

JUAN CARLOS. MUCHAS GRACIAS

PostPosted: Fri Jan 27, 2006 4:04 pm
by armandini
Gracias por tu ayuda.

PostPosted: Fri Jan 27, 2006 4:08 pm
by MarioG
hago una pequeña corrección:

oTXbrowse:bKeyDown := {|nk| if(nk = VK_RETURN, Mifuncion(), ;
if(nk = VK_F2, OtraFucnion(), nil )) }

PostPosted: Sat Jan 28, 2006 5:43 am
by Verhoven
Pero tal vez se vea mejor así:

oTXbrowse:bKeyDown := {|nk| MiFuncion(nk)}

function MiFuncion(nk)
do case
case nk = VK_RETURN
funcion1()
case nk = VK_F2
funcion2()
...
endcase
return
8)

GRACIAS A TODOS

PostPosted: Sat Jan 28, 2006 7:50 pm
by armandini
GRACIAS POR EL INTERES. YA TENGO FUNCIONANDO BIEN LAS DISTINTAS FUNCIONES PRODUCTO DE LA EVALUACION DE LA VARIABLE NK.
DE TODAS FORMAS ME QUEDA UNA DUDA. AL MIRAR LA CLASE Y EL METODO RESPECTIVO ENCUENTRO ALLI DOS (2) PARAMETROS:
"NKEY" Y "NFLAGS". EL PRIMERO GUARDA EL VALOR DE LA TECLA PULSADA Y EL SEGUNDO QUE GUARDA Y PARA QUE SE PUEDE UTILIZAR ??????

PostPosted: Sat Jan 28, 2006 9:52 pm
by Antonio Linares
De las documentación del API de Windows:
Code: Select all  Expand view
lKeyData

Value of lParam. Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown in the following table:

Value   Description
0-15   Specifies the repeat count. The value is the number of times the keystroke is repeated as a result of the user holding down the key.
16-23   Specifies the scan code. The value depends on the original equipment manufacturer (OEM).
24   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.
25-28   Reserved; do not use.
29   Specifies the context code. The value is always 0 for a WM_KEYDOWN message.
30   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.
31   Specifies the transition state. The value is always 0 for a WM_KEYDOWN message.