Jump to content

Capslock Ve Delphi 7


kaan_karabey
 Share

Recommended Posts

Bu konuyu nereye açaçağımı bilemedim o yüzden buraya açmaya karar verdim. programlamayla ilgili diye.yanlış yere açtıysam affola

 

Arkadaslar ben proje ödevi için delphi 7 de program yazdım program açıldıgında capslock tusunu da aktif etmesini istiyorum.CapsLocku Açma Ayarını nasıl yapacam acaba yardım edebilecek biri var mı?

Edited by kaan_karabey
Link to comment
Share on other sites

Bir de böyle bir kod buldum kendinize göre uyarlayabilirsiniz.

Eğer capslock kapalı ise açılmasını sağlayabilirsiniz:
 

 procedure ToggleNumLock;
 var
    KeyState: TKeyboardState;
 begin
    //note: Use VK_CAPITAL for Caps Lock
 
    GetKeyboardState(KeyState) ;
 
    //simulate key events (down + up)
    if (KeyState[VK_NUMLOCK] = 0) then
    begin
      Keybd_Event(VK_NUMLOCK, 1, KEYEVENTF_EXTENDEDKEY or 0, 0) ;
      Keybd_Event(VK_NUMLOCK, 1, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0) ;
    end
    else
    begin
      Keybd_Event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY or 0, 0) ;
      Keybd_Event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0) ;
    end;
 end; 
Link to comment
Share on other sites

 

Bir de böyle bir kod buldum kendinize göre uyarlayabilirsiniz.

Eğer capslock kapalı ise açılmasını sağlayabilirsiniz:
 

 procedure ToggleNumLock;
 var
    KeyState: TKeyboardState;
 begin
    //note: Use VK_CAPITAL for Caps Lock
 
    GetKeyboardState(KeyState) ;
 
    //simulate key events (down + up)
    if (KeyState[VK_NUMLOCK] = 0) then
    begin
      Keybd_Event(VK_NUMLOCK, 1, KEYEVENTF_EXTENDEDKEY or 0, 0) ;
      Keybd_Event(VK_NUMLOCK, 1, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0) ;
    end
    else
    begin
      Keybd_Event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY or 0, 0) ;
      Keybd_Event(VK_NUMLOCK, 0, KEYEVENTF_EXTENDEDKEY or KEYEVENTF_KEYUP, 0) ;
    end;
 end; 

bunu neresine yazacam anlamadım :(

Link to comment
Share on other sites

 

Orası sana kalmış bir durum ister load olayına ister buton koyun onun olayına yazabilirsin.Buton için.

procedure TForm1.Button1Click(Sender: TObject) ;
 begin
   ...
 end; 

öyle diyorsunda ben program çalıstıgı anda otomatik olarak capslock kapalı ise acmasını istiyorum.butonla falan değil.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...