Main Page   Data Structures   File List   Globals  

relay_MouseClicks.c

Go to the documentation of this file.
00001 #include "white_interface.h"
00002 
00035 int pass_mouse_clicks;
00036 
00051 /* Init Function */
00052 void poin_entry_Init()
00053 {
00054   /* Initially mouse_clicks should be handled by the lobby and
00055      not passed to the input module. */
00056   pass_mouse_clicks = 0;
00057 }
00058 
00059 
00064 /* Run Function */
00065 void poin_entry_Run()
00066 {
00067   mouse_click mouse_input;
00068  
00069   /* if something arrives on the trigger_in port, update the
00070      value of pass_mouse_clicks. */
00071 
00072   if (trigger_in_Enabled())
00073   {
00074     pass_mouse_clicks = trigger_in_Value();
00075   }
00076   
00077   /* if mouse clicks are received: */
00078   if (mouse_in_Enabled())
00079   {
00080     mouse_click mouse_input;
00081     mouse_input = *mouse_in_Value();
00082 
00083     /* either pass them to the input module or the lobby. */
00084 
00085     if (pass_mouse_clicks == 1)
00086       mouse_out_Post(&mouse_input);
00087     else
00088       lobby_mouse_out_Post(&mouse_input);
00089   }
00090 }
00091 

Copyright © 2002 Andrew Bates
Last Updated 04/04/02