void EventManager::ProcessMousePassive( int x, int y )
{
    ModifyMouseSensitivity( x, y );
    InputEvent event( MOUSE_MOVE_EVENT, 0, 0, Point( MouseXTo2dX( x ), MouseYTo2dY( y ) ) );
    globalEventManager().sendInputEvent( (event) );
    clearDeleteQueue();
}
void EventManager::ProcessMouseActive( int x, int y )
{
    ModifyMouseSensitivity( x, y );
    //FIXME mbyron -- Should provide info about which buttons are down.
    InputEvent event( MOUSE_DRAG_EVENT, 0, 0, Point( MouseXTo2dX( x ), MouseYTo2dY( y ) ) );
    globalEventManager().sendInputEvent( (event) );
    clearDeleteQueue();
}
示例#3
0
void setOperationalMode(int newmode) {
	extern void buildMyStatsCSV();
	extern void saveLogFile(int);
	
  if(newmode == (int)P_WAIT) {
  	// stop();  --- should we see if we can WAIT while paused in an audio file?
  	SysIntoWaitMode();
    // when leaving wait mode, next instruction is executed, so we return here
    return;
  } else {
		// give visual feedback of shutting down (aural feedback when user causes shutdown in takeAction())
 		setLED(LED_ALL,TRUE);
  		buildMyStatsCSV();
		buildExchgOstats();
 		clearDeleteQueue();
  		write_config_bin();  // build a config.bin
		writeVersionToDisk(SYSTEM_PATH);  // make sure the version file is correct
  		confirmSNonDisk(); // make sure the serial number file is correct 
 		//cleanUpOldRevs(); // cleanup any old revs 
    	// assume calling for sleep or halt
		*P_Clock_Ctrl |= 0x200;	//bit 9 KCEN enable IOB0-IOB2 key change interrupt
		if (newmode == (int)P_HALT)
			logString((char *)"Halting",BUFFER,LOG_NORMAL);
		else // newmode == (int)P_SLEEP
			logString((char *)"Sleeping",BUFFER,LOG_NORMAL);			
		
		saveLogFile(0);	
		
	  	Snd_Stop();    // no logging
		setLED(LED_ALL,FALSE);
	
		turnAmpOff();

		disk_safe_exit(0);
// try to get the sd card in a safe state - reversw what we do on startup		
		_deviceunmount(0);
		fs_uninit();
		SD_Uninitial();		

		turnSDoff();
		turnNORoff();
	  	
	  	if (newmode == (int)P_HALT)  {
/*
	  		setRTCalarmSeconds(61);		// device should come back on in 61 seconds
*/
		  	SysIntoHaltMode();
	  	}
		else { // newmode == (int)P_SLEEP
			disk_safe_exit(0);

			_SystemOnOff();
		}
	
		while(1);	
	    // cpu reset on exiting halt/sleep mode, so nothing below here executes
     }
}
示例#4
0
void housekeeping() {
		// give visual feedback of shutting down (aural feedback when user causes shutdown in takeAction())
	setLED(LED_ALL,TRUE);
	saveVolumeProfile();
	exportFlashStats();
	write_config_bin();  // build a config.bin
	//checkDoubleSRNprefix(); // this can be removed once the dup serial number prefixes are fixed
	//confirmSNonDisk(); // make sure the serial number file is correct 
	buildMyStatsCSV();
	buildExchgOstats();
	clearDeleteQueue();
	saveLogFile(0);	
}
void EventManager::ProcessMouseClick( int button, int state, int x, int y )
{
    ModifyMouseSensitivity( x, y );
    //Make sure we are working with the same "button" constants.
    assert( LEFT_MOUSE_BUTTON == WS_LEFT_BUTTON );
    assert( RIGHT_MOUSE_BUTTON == WS_RIGHT_BUTTON );
    assert( MIDDLE_MOUSE_BUTTON == WS_MIDDLE_BUTTON );
    assert( WHEELUP_MOUSE_BUTTON == WS_WHEEL_UP );
    assert( WHEELDOWN_MOUSE_BUTTON == WS_WHEEL_DOWN );
    if (state == WS_MOUSE_DOWN) {
        InputEvent event( MOUSE_DOWN_EVENT, button, 0, Point( MouseXTo2dX( x ), MouseYTo2dY( y ) ) );
        globalEventManager().sendInputEvent( (event) );
    } else {
        InputEvent event( MOUSE_UP_EVENT, button, 0, Point( MouseXTo2dX( x ), MouseYTo2dY( y ) ) );
        globalEventManager().sendInputEvent( (event) );
    }
    clearDeleteQueue();
}