FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour como invocar el metodo "KEYDOWN" en un txbrowse
Posts: 23
Joined: Wed Jan 04, 2006 07:48 PM
como invocar el metodo "KEYDOWN" en un txbrowse
Posted: Fri Jan 27, 2006 02:11 PM

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.

principiante
Posts: 219
Joined: Fri Nov 04, 2005 02:34 PM
Re: como invocar el metodo "KEYDOWN" en un txbrows
Posted: Fri Jan 27, 2006 02:13 PM
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 Salinas Ojeda

México. D.F.

-------------------------------------------------
Posts: 23
Joined: Wed Jan 04, 2006 07:48 PM
JUAN CARLOS. MUCHAS GRACIAS
Posted: Fri Jan 27, 2006 04:04 PM

Gracias por tu ayuda.

principiante
Posts: 1380
Joined: Fri Oct 14, 2005 01:28 PM
como invocar el metodo "KEYDOWN" en un txbrowse
Posted: Fri Jan 27, 2006 04:08 PM

hago una pequeña corrección:

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

Resistencia - "Ciudad de las Esculturas"

Chaco - Argentina
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM
como invocar el metodo "KEYDOWN" en un txbrowse
Posted: Sat Jan 28, 2006 05:43 AM

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)

Posts: 23
Joined: Wed Jan 04, 2006 07:48 PM
GRACIAS A TODOS
Posted: Sat Jan 28, 2006 07:50 PM

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 ??????

principiante
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
como invocar el metodo "KEYDOWN" en un txbrowse
Posted: Sat Jan 28, 2006 09:52 PM
De las documentación del API de Windows:
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.
regards, saludos

Antonio Linares
www.fivetechsoft.com

Continue the discussion