Beispiel #1
0
 public void ReleaseMouse()
 {
     if (mouse != null)
     {
         mouse.Unacquire();
         mouse.Dispose();
     }
     mouse = null;
 }
Beispiel #2
0
 public void AcquireMouse(Form1 zw)
 {
     ziggyWin = zw;
     // DirectInput dinput = new DirectInput();
     //mouse = new Mouse(dinput);
     //CooperativeLevel coopLevel = CooperativeLevel.Exclusive | CooperativeLevel.Foreground;
     mouse = new DirectInput.Device(DirectInput.SystemGuid.Mouse);
     mouse.SetDataFormat(DirectInput.DeviceDataFormat.Mouse);
     DirectInput.CooperativeLevelFlags coopLevel = DirectInput.CooperativeLevelFlags.Exclusive | DirectInput.CooperativeLevelFlags.Foreground;
     mouse.SetCooperativeLevel(ziggyWin, coopLevel);
     mouse.Acquire();
 }