⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mouseth.pas

📁 An approach to implement the spacemouse to Delphi.
💻 PAS
字号:
unit MouseTh;

interface

uses

    Windows,   // fuer Debugdeklaration etc.
    Classes,
    Forms,
    StdCtrls,  // TMemo
    ComCtrls,  // Richedit
    Dialogs,   // MessageDLG
    Messages,
    SpaceMouse,
    SysUtils;


type
  TSpaceM = class(TThread)
  private
      Hnd : THandle;
      DevHdl : SiHdl;
      Res    : Integer;
      counter : integer;
      T1,t2,t3,t4:string;
      Identity : String;
      Procedure Sync;
  protected
      procedure Execute; override;
      Function SbInit : Integer;
  Public
       OK         : Bool;
       constructor Create(Fhnd : THandle;ident : String); virtual;
       Destructor Destroy; Override;

  end;

implementation
uses main;
{ TSpaceM }

Function TSpaceM.SbInit : Integer;
Var   oData : SiOpenData;           //* OS Independent data to open ball  */
      Test : integer;
Begin
//  if (SiInitialize = SPW_DLL_LOAD_ERROR) then begin
      if (SiInitialize = 8) then begin
     	  Messagedlg('Kann 3DMouse nicht laden',mtInformation,[mbok],0);
          Result:=0;
          exit;
      end;
   
     SiOpenWinInit(@oData, Hnd);    //* init Win. platform specific data  */

//      devHdl := SiOpen(Identity, SI_ANY_DEVICE, SI_NO_MASK,SI_EVENT, @oData);
       devHdl := SiOpen(Identity, Hnd, SI_NO_MASK,SI_EVENT, @oData);
      if devhdl = 0 then begin
        SiTerminate;  //* called to shut down the SpaceWare input library */
        Result:=0;
      end else Result:=1;
      SiSetUiMode(devHdl, SI_UI_All_CONTROLS); //* Config SoftButton Win Display */
End;


constructor TSpaceM.Create(Fhnd : THandle;ident : String);
begin
  OK:=False;
  identity:=ident;
  Hnd:=Fhnd;
//  Hnd:=Form1.Handle;

  inherited Create(True);  // wenn True, mu

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -