攔截keyboard |
答題得分者是:banson1716
|
kkccgg
初階會員 發表:50 回覆:54 積分:30 註冊:2002-07-28 發送簡訊給我 |
|||
william
版主 發表:66 回覆:2535 積分:3048 註冊:2002-07-11 發送簡訊給我 |
Do you mean system hook? Try searching using the word "hook". You will need to create a dll for global system hook. http://delphi.ktop.com.tw/topic.php?topic_id=19936
|
||
banson1716
高階會員 發表:55 回覆:182 積分:167 註冊:2002-04-14 發送簡訊給我 |
|||
dllee
站務副站長 發表:321 回覆:2519 積分:1711 註冊:2002-04-15 發送簡訊給我 |
引言: 請問如何欄截鑑盤按鍵? 謝謝以下的元件有攔截鍵盤及滑鼠,可以參考一下。 檔案名稱:vidle.zip 網址:http://www.torry.net/vcl/datetime/timers/vidle.zip 大小: 5KB 完成時間:Thu Jan 09 14:47:14 2003 參照頁:http://www.torry.net/timers.htm 註解:TVIdle Timer v.1.01 FWS 5 Kb 27.01.98 By Todd Frankson. TVIdleTimer is a descendant of TTimer with new properties and methods for determining the idle time of your application's user. Fully functional Source: Included Download: D3 沒空更新的網頁...
------
http://www.ViewMove.com |
||
banson1716
高階會員 發表:55 回覆:182 積分:167 註冊:2002-04-14 發送簡訊給我 |
攔截事件(鍵盤)
if FEnableESCtoExit then
begin
with TForm(Owner) do
begin
FOnKeyPress := OnKeyPress;
OnKeyPress := KeyPress;
end;
end; FOnKeyPress 型態是 TKeyPressEvent 按下鍵盤的事件型態
OnKeyPress 指 Form 的鍵盤按鍵事件處理器
KeyPress 新元件內的鍵盤按鍵事件處理器
---------------------------
Form 的鍵盤按鍵事件處理器
procedure TOpenGL.KeyPress(Sender: TObject; var Key: Char);
begin
if FEnableESCtoExit and (Key=#27) then
SendMessage(TForm(Owner).Handle, WM_CLOSE, 0, 0); if Assigned(FOnKeyPress) then
FonKeyPress(Sender, Key);
end;
元件內理完事件後將原有鍵盤資料原封不動傳回給原來事件處理器
|
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |