Ver Mensaje Individual
  #1  
Antiguo 09-10-2005
Avatar de Dexter182
Dexter182 Dexter182 is offline
Miembro
 
Registrado: jul 2005
Ubicación: Argentina
Posts: 95
Reputación: 19
Dexter182 Va por buen camino
Unhappy Problemas al capturar teclas

Alguien sabría decirme el porque de que no pueda capturar las teclas
F1 ... F12 en el evento OnKeyPress de un formulario.

Tengo activada la propiedad KeyPreview y he probado varias cosas:

IF Key = #112 then //Si se presione F1
....
IF Key = VK_F1 then
....

pero ninguna me funcionó. Sin embargo, las teclas Enter (#13), Escape (#27),
las capturo sin ningún tipo de problemas.

El código es el siguiente:
Código:
  
  Case Key of
	  #13:
		begin
		  Key := #0;
		  //Focus al siguiente objeto
		  Perform(WM_NEXTDLGCTL, 0, 0);
		end;
	  #27:
		begin
		  Key := #0;	  
		  //Cierra el formulario
		  Close; 
		end;
	  #112:
		begin
		  Key := #0;
		  //Cambia de página
		  PageControl.TabIndex := 1;
		end;
Si alguien me puede orientar les estaría agradecido.
Un saludo.
Responder Con Cita