como invocar el metodo "KEYDOWN" en un txbrowse

como invocar el metodo "KEYDOWN" en un txbrowse

Postby armandini » Fri Jan 27, 2006 2: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
armandini
 
Posts: 23
Joined: Wed Jan 04, 2006 7:48 pm
Location: Bucaramanga/Colombia

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

Postby VeRCE » Fri Jan 27, 2006 2: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.
-------------------------------------------------
User avatar
VeRCE
 
Posts: 219
Joined: Fri Nov 04, 2005 2:34 pm
Location: Mexico D.F.

JUAN CARLOS. MUCHAS GRACIAS

Postby armandini » Fri Jan 27, 2006 4:04 pm

Gracias por tu ayuda.
principiante
armandini
 
Posts: 23
Joined: Wed Jan 04, 2006 7:48 pm
Location: Bucaramanga/Colombia

Postby MarioG » Fri Jan 27, 2006 4: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
User avatar
MarioG
 
Posts: 1380
Joined: Fri Oct 14, 2005 1:28 pm
Location: Resistencia - Chaco - AR

Postby Verhoven » Sat Jan 28, 2006 5: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)
Verhoven
 
Posts: 505
Joined: Sun Oct 09, 2005 7:23 pm

GRACIAS A TODOS

Postby armandini » Sat Jan 28, 2006 7: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
armandini
 
Posts: 23
Joined: Wed Jan 04, 2006 7:48 pm
Location: Bucaramanga/Colombia

Postby Antonio Linares » Sat Jan 28, 2006 9:52 pm

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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41441
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin para Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 81 guests