Sierra Wireless Writing an embedded application loader Instrukcja Użytkownika Strona 83

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 102
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 82
GHI Electronics,LLC Embedded Master User Manual
Hardware and Software Library
Example
Initialization of a mouse:
// *mouse* is connected and *device* refers to the system device, mouse.
mouse = new Mouse(device);
// event for disconnection
mouse.Disconnected += MouseDisconnected;
// Set scale
mouse.SetScale(-screen.Width / 2, screen.Width / 2, -screen.Height / 2, +screen.Height
/ 2, -512, 512);
// Set cursor range
mouse.SetCursorBounds(0, screen.Width, 0, screen.Height, 0, screen.Height);
// Event when a button is pressed
mouse.MouseDown += MouseButtonDown;
// Event when the position has changed
mouse.MouseMove += MousePositionChanged;
Handling Events:
public void MouseButtonDown(Mouse sender, MouseEventArgs e)
{
// Did the right button change?
if(e.ChangedButton == MouseButton.Right)
{
// Do something...
}
}
public void MousePositionChanged(Mouse sender, MouseEventArgs e)
{
// sender.Cursor.X contains the X position
// sender.LeftButton contains the state of the left button ...
}
Reference
GHIElectronics.System.SystemDevices.Mouse
GHIElectronics.System.SystemDevices.MouseButton
GHIElectronics.System.SystemDevices.MouseButtonState
GHIElectronics.System.SystemDevices.MouseCursor
GHIElectronics.System.SystemDevices.MouseDeltaPosition
GHIElectronics.System.SystemDevices.MouseEventArgs
GHIElectronics.System.SystemDevices.MouseEventHandler
Rev. 2.06 TFT Page 83 of 102 www.ghielectronics.com
Przeglądanie stron 82
1 2 ... 78 79 80 81 82 83 84 85 86 87 88 ... 101 102

Komentarze do niniejszej Instrukcji

Brak uwag