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

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 23-11-2009
Avatar de matabyte
matabyte matabyte is offline
Miembro
 
Registrado: ene 2008
Ubicación: Kyoto, Japon
Posts: 177
Poder: 17
matabyte Va por buen camino
Encender y apagar leds del teclado.

Buenas, como siempre con una pregunta

Sabéis alguna forma de encender en Delphi los LEDs del teclado? Me refiero a los "Scroll Lock", "Caps Locks" y el "Num Lock".

Gracias por la ayuda
Responder Con Cita
  #2  
Antiguo 23-11-2009
Avatar de matabyte
matabyte matabyte is offline
Miembro
 
Registrado: ene 2008
Ubicación: Kyoto, Japon
Posts: 177
Poder: 17
matabyte Va por buen camino
Me autorespondo y dejo la solución por si alguien también tiene el mismo problema

Código Delphi [-]
procedure ToggleNumLock(tecla:integer);
var
   KeyState: TKeyboardState;
begin
   //note: Use VK_CAPITAL for Caps Lock

   GetKeyboardState(KeyState) ;

   //simulate key events (down + up)
   if (KeyState[tecla] = 0) then
   begin
     Keybd_Event(tecla, 1, KEYEVENTF_EXTENDEDKEY or 0, 0) ;
     Keybd_Event(tecla, 1, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0) ;
   end
   else
   begin
     Keybd_Event(tecla, 0, KEYEVENTF_EXTENDEDKEY or 0, 0) ;
     Keybd_Event(tecla, 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0) ;
   end;
end;

procedure ParpadearTimer(Sender: TObject);
begin
  parpadear.Enabled:=false;
     if radionumlock.Checked then ToggleNumLock(VK_NUMLOCK);
     if radiomayusculas.Checked then ToggleNumLock(VK_CAPITAL);
     if radioscroll.Checked then ToggleNumLock(VK_SCROLL);
  parpadear.Enabled:=true;
end;
Responder Con Cita
  #3  
Antiguo 23-11-2009
Avatar de rgstuamigo
rgstuamigo rgstuamigo is offline
Miembro
 
Registrado: jul 2008
Ubicación: Santa Cruz de la Sierra-Bolivia
Posts: 1.646
Poder: 17
rgstuamigo Va por buen camino
Arrow

Yo no veo diferencia entre esto
Código Delphi [-]
Keybd_Event(tecla, 1, KEYEVENTF_EXTENDEDKEY or 0, 0) ;
Keybd_Event(tecla, 1, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0) ;
y esto
Código Delphi [-]
Keybd_Event(tecla, 0, KEYEVENTF_EXTENDEDKEY or 0, 0) ;
Keybd_Event(tecla, 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0) ;
Cual es la diferencia? Y por que el if?.
Otra observacion que veo es que estas deshabilitando tu Timer antes de ejecutar las demas lineas, lo cual implica que nunca se ejecutaran,
Te funciona asi??.
Saludos...
__________________
"Pedid, y se os dará; buscad, y hallaréis; llamad, y se os abrirá." Mt.7:7
Responder Con Cita
Respuesta



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
Encender y Apagar PC chona Varios 22 14-11-2008 17:49:38
Encender una PC remota Cronos Redes 14 08-07-2005 08:58:56
'Encender/Apagar' el firebird Engine JoseQ Firebird e Interbase 1 28-09-2004 22:10:50
probloblemas al encender el PC Giniromero Varios 3 21-07-2004 12:20:23
encender un dispositivo noe Varios 3 25-02-2004 23:05:30


La franja horaria es GMT +2. Ahora son las 01:14:59.


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