首页 > 代码库 > delphi winio 输入
delphi winio 输入
var
key:byte;//ASCII码
btScancode:DWord; //键码
begin
key:=VkKeyScan(‘b‘);
btScancode:= MapVirtualKey(key, 0);
end;
//winio模拟,大小写需要自己模拟shift键盘自己转化。
procedure KBCWait4IBE; //等待键盘缓冲区为空
var
dwVal:DWord;
begin
repeat
GetPortVal($64,@dwVal,1);
until (dwVal and $2)=0;
end;
procedure MyKeyDown(vKeyCoad:Integer);
var
btScancode:DWord;
begin
btScancode:=MapVirtualKey(vKeyCoad, 0);
KBCWait4IBE;
SetPortVal($64, $D2, 1);
KBCWait4IBE;
SetPortVal($60, btScancode, 1);
end;
procedure MyKeyUp(vKeyCoad:Integer);
var
btScancode:DWord;
begin
btScancode:=MapVirtualKey(vKeyCoad, 0);
KBCWait4IBE;
SetPortVal($64, $D2, 1);
KBCWait4IBE;
SetPortVal($60, (btScancode or $80), 1);
end;
procedure TForm1.Timer1Timer(Sender: TObject);
var
i:Byte;
begin
MyKeyDown(VK_SHIFT);
MyKeyDown(VkKeyScan(‘b‘));
Sleep(50);
MyKeyUp(VkKeyScan(‘b‘));
MyKeyUp(VK_SHIFT);
end;
delphi winio 输入
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。