See site in english Voir le site en francais
Website skin:
home  download  forum  link  contact

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

Author Topic: Using the Orbiter API to programmatically click a DGIV switch  (Read 1845 times)

0 Members and 1 Guest are viewing this topic.

Offline meson800

  • Newbie
  • *
  • Posts: 1
  • Karma: 0
01 February 2012, 02:01:29
For a simpit dedicated to the DGIV that I am creating, I need to know how to click one of the DGIV's switches.  My design has switches connected to a microcomputer (Arduino), and the microcomputer sends switch positions to a custom Orbiter module through a serial port.

So far, my module looks for a vessel named 'DGIV_SIM' (which will always be a DGIV), creates a VESSEL2 interface, then invokes the interface's clbkPanelMouseEvent.

Code: [Select]
OBJHANDLE hVessel = oapiGetVesselByName("DGIV_SIM");
if (oapiIsVessel(hVessel))
{
VESSEL2 vesselInterface = VESSEL2(hVessel,1);
vesselInterface.clbkPanelMouseEvent(0,PANEL_MOUSE_LBDOWN,1,1);
}

If this is the correct way to simulate a click event, then does anybody know the correct ID, MX, and MY values?  
If this is not the correct way, then how would I simulate a mouse click?


« Last Edit: 01 February 2012, 02:01:29 by meson800 »