2009年5月30日

Delphi JEDI Mouse Gesture 滑鼠手勢


需先安裝 JEDI VCL for Delphi

在 Form 中
放入 TMemo 顯示訊息
放入 Jv Non-Visual -> TJvMouseGestureHook
加入 JvMouseGestureHook1.OnouseGestureCustomInterpretation 事件

procedure TForm1.JvMouseGestureHook1MouseGestureCustomInterpretation(
Sender: TObject; const AGesture: String);
begin
Memo1.Lines.Add(AGesture);
end;

加入 Form1 OnCreate 事件

procedure TForm1.FormCreate(Sender: TObject);
begin
JvMouseGestureHook1.Active := True;
end;

執行程式,即可用滑鼠右鍵拖曳畫出方向
上 U
下 D
左 L
右 R
左下 1
右下 3
左上 7
右上 9

沒有留言:

網誌存檔