Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #21  
Antiguo 23-07-2017
Juampi Juampi is offline
Miembro
NULL
 
Registrado: may 2017
Posts: 14
Poder: 0
Juampi Va por buen camino
Si si, Lazarus, jeje.

Cita:
Empezado por AgustinOrtu Ver Mensaje
No me percate de que estabamos hablando de Lazarus
En un momento me imaginé que venía por ese lado el tema.

Cita:
Empezado por AgustinOrtu Ver Mensaje

Acabo de hacer esta sencilla prueba y me funciona bien:

Código Delphi [-]
uses
  LCLType;

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
  if Key = VK_NUMPAD0 then
     ShowMessage('VK_NUMPAD0');

  if Key = VK_MULTIPLY then
     ShowMessage('VK_MULTIPLY');
end;

Obvio que es necesario tener KeyPreview a True
¿Dónde iría el "uses LCLType;"?, porque lo puse inmediatamente antes del procedure tal cual lo tienes ahí y cuando compilo me pone:

"Fatal: Syntax error, "BEGIN" expected but "USES" found"

Actualmente el código está así:

Código Delphi [-]
{___________________________________________________________________________________________________  _________________________________________________________

--- EVENTO KEYDOWN ---
____________________________________________________________________________________________________  _________________________________________________________}

uses LCLType;

procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);

begin

 {BOTÓN 0}

  if key = 96 then
  begin
    btn0.Click;
  end;

 {BOTÓN 1}

  if key = 97 then
  begin
    btn1.Click;
  end;

 {BOTÓN 2}

  if key = 98 then
  begin
    btn2.Click;
  end;

 {BOTÓN 3}

  if key = 99 then
  begin
    btn3.Click;
  end;

 {BOTÓN 4}

  if key = 100 then
  begin
    btn4.Click;
  end;

 {BOTÓN 5}

  if key = 101 then
  begin
    btn5.Click;
  end;

 {BOTÓN 6}

  if key = 102 then
  begin
    btn6.Click;
  end;

 {BOTÓN 7}

  if key = 103 then
  begin
    btn7.Click;
  end;

 {BOTÓN 8}

  if key = 104 then
  begin
    btn8.Click;
  end;

 {BOTÓN 9}

  if key = 105 then
  begin
    btn9.Click;
  end;

 {BOTÓN <}

  if key = 08 then
   begin
     btnBS.Click;
   end;

  {VK_MULTIPLY}

    if key = 106 then
   begin
     btnMultiplicacion.Click;
   end;

  {VK_ADD}

  if key = 107 then
   begin
     btnSuma.Click;
   end;

  {VK_SUBTRACT}

  if key = 109 then
   begin
     btnResta.Click;
   end;

  {VK_DECIMAL}

  if key = 110 then
   begin
     btnComa.Click;
   end;

  {VK_DIVIDE}

  if key = 111 then
   begin
     btnDivision.Click;
   end;

  {VK_RETURN}

  if key = 13 then
   begin
     btnIgual.Click;
   end;

end;

Gracias.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
Opinión sobre la estabilidad actual de Lazarus/Free Pascal Toni Lazarus, FreePascal, Kylix, etc. 34 06-02-2016 01:04:45
Soy desarrollador de Delphi ¿Que necesito saber para usar Lazarus? Godzuki Linux 7 23-02-2012 23:54:34
Lazarus, Nemesis Pascal rmendoza83 Varios 1 08-01-2009 17:41:08
Indy soporta Free Pascal/Lazarus Delfino Noticias 6 15-01-2006 10:55:55
Free Pascal y Lazarus Magician^ Noticias 7 31-03-2004 19:12:04


La franja horaria es GMT +2. Ahora son las 12:05:56.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi