protected void checkBuffer(){
		int touch = _buffer.indexOf("Touch");
		int end = _buffer.indexOf("End");
		Matcher m = _pattern.matcher(_buffer.toString());
		
		
		
		if(touch != -1){
			//System.out.println("Touch");
			_buffer.delete(0, touch+ "Touch".length() + 1);
			_touched = true;
		} 
		else if (m.find()) {
			_buffer.delete(0, m.start()+ m.group().length() + 1);
			//System.out.println("--> " + m.group());
			
			String[] coords = m.group().trim().split("x");
					
			
			
			//transform the coordinates
			
			int x = (int)((Integer.parseInt(coords[0]) - _callibration[0].x) * _xFactor) ;
			if(x < 0) x = 0; if(x >= _screenSize.width) x = _screenSize.width-1;
			
			int y = (int)((Integer.parseInt(coords[1]) - _callibration[1].x) * _yFactor) ;
			if(y < 0) y = 0; if(y >= _screenSize.height) y = _screenSize.height-1;
			
			_mouse.mouseMove(x, y);
			if(_touched){
				_mouse.mousePress(InputEvent.BUTTON1_DOWN_MASK);
				_touched = false;
			}
		}
		else if(end != -1){
			//System.out.println("End");
			_buffer.delete(0, end + "End".length() + 1);
			_mouse.mouseRelease(InputEvent.BUTTON1_DOWN_MASK);
			_touched = false;
		}
	}