争怎路由网:是一个主要分享无线路由器安装设置经验的网站,汇总WiFi常见问题的解决方法。

对于控制CAPS LOCK按键

时间:2024/7/16作者:未知来源:争怎路由网人气:

用于function中

const
   SCROLLLOCK = 1;
   NUMLOCK    = 2;
   CAPSLOCK   = 4;

var
   Status:  Byte;
   PntK:    ^Byte;
begin
     PntK := Ptr($40, $97); {directly point in
memory}
     Status := Byte(PntK^); {read the status}
     if (NUMLOCK and Status) = NUMLOCK then {if NUM
LOCK is on}
         Status := Status and (255 - NUMLOCK) {turn it
off}
     else
         Status := Status or 2; {turn it
on}
     Pntk^ := Status; {poke in
memory (don't works)}
end;

A:
I use this procedures to turn on the caps lock if it isn't
already on when
the user enters my DBloockup combo.  This gets rid of the
nasty problem
of case-sensitive indexes.

procedure TMainForm.StudentLookupEnter(Sender: TObject);
Var Level : Integer;
    KeyState : TKeyBoardState;
begin
  {check if caps-lock is on - if not turn it on}
  Level := GetKeyState(VK_CAPITAL);
  GetKeyboardState(KeyState);
  CapsLockStatus := KeyState;
  If Level = 0 then
    begin
      KeyState[VK_CAPITAL] := 1;
      setKeyboardState(KeyState);
    end;
end;

关键词:对于控制CAPS LOCK按键




Copyright © 2012-2018 争怎路由网(http://www.zhengzen.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版