亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? tchstub.cpp

?? 觸摸屏驅動源碼
?? CPP
?? 第 1 頁 / 共 4 頁
字號:
    if ((0 != (Flags&TouchSamplePreviousDownFlag)) && 
        (0 == (Flags&TouchSampleDownFlag))            )    // for the first sample with the pen up
    {

        // check for errors, stop and report them if so.  Ignore short strokes as the measurement is likely to be inaccurate
        //@todo - should this be every stroke, or average out for 5 strokes, or maybe every 5th stroke?
        if (nTicksNow - nStrokeStartTick > SMALL_STROKE_THRESHOLD)
        {
            // calculate statistics
            if (nTicksNow != nStrokeStartTick)
                samplesPerSecond = (sampleCount*1000)/(nTicksNow - nStrokeStartTick);
            if (nLongIntervalCount)
                nLongIntervalAvg = nLongIntervalSum/nLongIntervalCount;
            else
                nLongIntervalAvg = 0;
            if (nPointSkips)
            {
                nPointSkipAvg = nPointSkipSum/nPointSkips;
            }
            else
                nPointSkipAvg = 0;

            if (nLongIntervalCount > 0 || nPointSkips > 0 || samplesPerSecond < POINT_RATE_THRESHOLD)
            {
                if( !_bNoDbgMsg )
                {
                    static HANDLE hThread = NULL;
                    DWORD dwExitCode = 0;

                    // Check the Exit code of the Error message thread to see if there is a thread already running.
                    // If the thread is still active, skip this message. (This will be always logged to the file.)
                    if( hThread )
                        GetExitCodeThread(hThread, &dwExitCode);

                    if( NULL == hThread || STILL_ACTIVE != dwExitCode)
                    {
                        EnterCriticalSection(&csErrMsg);
                        // Fill the global error message buffer.
                        wsprintf(_szErrorMsg, 
                            TEXT("TRANSCRIBER MAY NOT WORK WELL GIVEN THE CURRENT POINT RATE AND LATENCY! ")
                            TEXT("INKSAMP2 at osfiles\\PUBLIC\\COMMON\\OAK\\DEMOS can help debug this.\n")
                            TEXT("Samples per second: %d (100 min) \n Long intervals: %d (0 Max) \n Avg. long interval duration %d\n Total long interval duration %d\n Ink skips %d (0 max)\n Avg Ink Skip squared %d."), 
                            samplesPerSecond, nLongIntervalCount, nLongIntervalAvg, nLongIntervalSum, nPointSkips, nPointSkipAvg);
                        LeaveCriticalSection(&csErrMsg);

                        // Create a new thread to display the error message, to make sure that we are not blocking the
                        // touch driver thread so that touch driver will be active even with the message box.
                        hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)TchMessageBoxThread, NULL, 0, NULL);
                        if( NULL == hThread )
                        {
                            MYERRORMSG(1, (__TEXT("Couldn't create touchstub window thread.\r\n")));
                        }
                        // Since we have shown this msg once, turn off the message box.
                        _bNoDbgMsg = TRUE;
                    }
                }

                // Log the error to a log file also.
                HANDLE hFile;

                // Open/Create the log file.
                hFile = CreateFile(TEXT("\\tchDbg.log"), GENERIC_WRITE, 0, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
                if(hFile!=INVALID_HANDLE_VALUE)
                {
                    DWORD dw = 0;
                    int   len;
                    int   i;
                    TCHAR szBuffer[2*MAX_PATH];
                    unsigned char strLogMsg[2*MAX_PATH];

                    // Check if the log file already exist and we just opened it.
                    if( 0 == GetLastError() )
                    {
                        // This file did not exist before, so write the header information for the log.
                        SetFilePointer(hFile, 0, NULL, FILE_END);

                        wsprintf(szBuffer, L"TRANSCRIBER MAY NOT WORK WELL GIVEN THE CURRENT POINT RATE AND LATENCY! \n"
                            L"INKSAMP2 at osfiles\\PUBLIC\\COMMON\\OAK\\DEMOS can help debug this.\n"
                            L"Log contains the following values:\n"
                            L"Samples per second: (100 min), Long intervals: (0 Max), Avg. long interval duration, Total long interval duration, Ink skips (0 max), Avg Ink Skip squared.\n" ); 

                        len = _tcslen(szBuffer); 
                        for (i = 0; i < len; i ++) 
                            strLogMsg[i] = (unsigned char)szBuffer[i]; 
                        strLogMsg[len] = 0;

                        WriteFile(hFile, strLogMsg, len, &dw, NULL);
                    }

                    // Make sure we are at the end of the file.
                    SetFilePointer(hFile, 0, NULL, FILE_END);

                    // Fill the buffer
                    wsprintf(szBuffer, L"%d , %d , %d , %d , %d , %d \n", 
                        samplesPerSecond, nLongIntervalCount, nLongIntervalAvg, nLongIntervalSum, nPointSkips, nPointSkipAvg);

                    // Copy the Wide char string to uchar string.
                    len = _tcslen(szBuffer); 
                    for (i = 0; i < len; i ++) 
                        strLogMsg[i] = (unsigned char)szBuffer[i]; 
                    strLogMsg[len] = 0;

                    // Write the string to the log file.
                    WriteFile(hFile, strLogMsg, len, &dw, NULL);

                    CloseHandle(hFile);
                }
            }
        }
    }


#endif


   if (NULL == *_phStubWnd)
	IsStubWndExist();

   dwTick = GetTickCount();
   // Check if we need to send this point to system or transcriber.
   // If we are are in Out Of Memory state (Indicated by Tch thread in high priority), which prevents us from 
   // communicating with transcriber, we need to send the points to system instead of transcriber.
   if( _hClientWnd==NULL || 
	   _bTchThreadHighPriority || 
      *_phStubWnd==NULL ||
      (Flags&TouchSampleValidFlag)==0 ||
      (Flags&TouchSampleIgnore)!=0)
     {
#ifdef DEBUG1
	   	 wsprintf(str, TEXT(" *** CgrCallback -  sending point to  (%x) *** \n"), v_pfnCgrPointCallback);
		 OutputDebugString( str);
#endif
         (*v_pfnCgrPointCallback)(Flags, X, Y);
         return 0;           
     }
// PostMessage(*_phStubWnd, WM_STUB_TABLET, dwTick,((Flags<<26)|((X&0x01FFF)<<13)|(Y&0x01FFF)));
//   StubCallback2(dwTick, Flags, X, Y);
#ifdef DEBUG1
   wsprintf(str, TEXT(" *** CgrCallback - Transcriber is eating point (%d,%d) to hwnd %x*** \n"), X, Y, _hClientWnd);
		OutputDebugString( str);
#endif

     SendPtToSelf(Flags, X, Y);
	 return 0;
}


/* *********************************************************************************** */
// This takes points off the internal Touch Driver queue (Q2) and decides where to send them 
//  - either to Transcriber, or back to the system
void StubCallback2(
   DWORD dwTick0,
	TOUCH_PANEL_SAMPLE_FLAGS	Flags,
	INT	X,
	INT	Y
    )
{
 DWORD dwTick = dwTick0;
 TOUCH_PANEL_SAMPLE_FLAGS FlagsToDll = Flags, FlagsToWnd = Flags;

#if WRITE_STATISTICSINNER	// turn on to see points we place into the queue for the app
   {
    static int   _iStat1Writes = 0;
    static int   _iStat1Current = 0;
    static short _iStat1Buf[MAX_STATS][3] = {0};
    static int   count = 0;


      _iStat1Buf[_iStat1Current][0] = (short)Flags;
      _iStat1Buf[_iStat1Current][1] = (short)X;
      _iStat1Buf[_iStat1Current][2] = (short)Y;
      _iStat1Current++;
      
	  if(_iStat1Current==MAX_STATS)
         {
          HANDLE hFile = INVALID_HANDLE_VALUE;
          int i;

 
		  
		  _iStat1Current = 0;

             hFile = CreateFile(L"\\tchlogInner.txt", GENERIC_WRITE, 0, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
             if(hFile!=INVALID_HANDLE_VALUE)
                {
                 DWORD dw = 0;
				 int   len;
				 int   j;
      
				 SetFilePointer(hFile, 0, NULL, FILE_END);

				   for (i = 0; i < MAX_STATS; i++)
				   {
				    TCHAR str[64];
					unsigned char str2[64];

                    wsprintf(str, L"%d %d %d %d %c%c", count++, (int)_iStat1Buf[i][1], (int)(3000 - _iStat1Buf[i][2]), (int)_iStat1Buf[i][0], (TCHAR)13, (TCHAR)10); 
  		            
					len = _tcslen(str); 
					if(len > 62) 
						len = 62;

					for (j = 0; j < len; j ++) 
						str2[j] = (unsigned char)str[j]; 
					str2[len] = 0;
					
					WriteFile(hFile, str2, len, &dw, NULL);

				   }

                   CloseHandle(hFile);
                }

         }
   }
#endif


   // if we don't have a callig client window or bad sample or we are ignoring it,
   // or we are in Out Of Memory state (Indicated by Tch thread in high priority), which prevents us from 
   // communicating with transcriber, pass back to the system (so the app "underneath" transcriber will get them)
   if(_hClientWnd==NULL ||
       _bTchThreadHighPriority ||
      (Flags&TouchSampleValidFlag)==0 ||
      (Flags&TouchSampleIgnore)!=0)
     {
         (*v_pfnCgrPointCallback)(Flags, X, Y);
#ifdef DEBUG2
         OutputDebugString(L"CgrTouch Point 1\n");
#endif
         return;
     }

//	Intercept points here
   //1. test window at stroke begining 
   // 0x07 means pen down, valid, callib, but pen wasn't down for the previous pt
   if(Flags==0x07)
      {
         if(!IsWindow(_hClientWnd))
            {
               _hClientWnd = NULL;
               (*v_pfnCgrPointCallback)(Flags, X, Y);
#ifdef DEBUG2
         OutputDebugString(L"CgrTouch Point 2\n");
#endif
               return;
            }

        // set flags 
        _iClientFlags = (int)GetWindowLong(_hClientWnd, 0);
        //just adjust

        if((_iClientFlags&TABLET_TEST_FIRST_POINT)!=0 &&
           !SendMessage(_hClientWnd, WM_PEGREC_FIRSTPOINT, 0, MAKELPARAM(X, Y)))
           {
              _iClientFlags = TABLET_ALL_TO_SYSTEM;
           }

        if((_iClientFlags&TABLET_SMART_TO_SYSTEM)!=0)
           _iClientFlags = _iClientFlags&(~TABLET_ALL_TO_SYSTEM);
           

        if((_iClientFlags&TABLET_SAVE_FOCUS_WND)!=0)
           {

                  //@todo - do we need FindForegroundFocusWindow( ) instead of GetForegroundWindow( )?
                  _hLastTouchFocusWnd = GetForegroundWindow();  
           }
        begTick = dwLastDelayTick = dwTick;
        _begX = iLastDelayX = X;
        _begY = iLastDelayY = Y;
        bClick = FALSE;
        bDelay = FALSE;
        bNear = TRUE;
      } // if(flgs==07)


   if((_iClientFlags&TABLET_SMART_TO_SYSTEM)!=0)
      {   
         //2. Is still near?
         if( bNear                          && 
             Flags==0x0f /*inter point*/   &&
            (Flags&TouchSampleDownFlag)!=0 &&
            (_begX-X>=iMaxClickDist || _begX-X<=-iMaxClickDist ||
             _begY-Y>=iMaxClickDist || _begY-Y<=-iMaxClickDist))
            {  // decision = no click and no initial delay => stop NEAR
               bNear = FALSE;
               if((_iClientFlags&TABLET_SEND_RELEASE_MSG)!=0)
                    SendPtToWnd((TouchSamplePreviousDownFlag|TouchSampleDownFlag|TouchSampleIgnore), X, Y);
                                   iLastDelayX = X;
                                   iLastDelayY = Y;
                                   dwLastDelayTick = dwTick;
					{
                       HANDLE  hThread=GetCurrentThread();
                       SetThreadPriority(hThread, THREAD_PRIORITY_HIGHEST);
					}
            }

         // IS CLICK?
         if( bNear                                     &&
             Flags==0x0d      /*LAST PT*/              &&
             (_iClientFlags&TABLET_CLICK_TO_SYSTEM)!=0 &&
             dwTick-begTick < dwMaxClickTime           &&
             begTick-_dwLastSendedTick > dwMinPauseBeforeClick) 
            {  //yes - it's click
              HWND hWndFgr = GetForegroundWindow();
              BOOL bPermition = TRUE;
               bClick = TRUE;
               _dwLastSendedTick = 0;
               if((_iClientFlags&(TABLET_SEND|TABLET_NEED_PERMITION))!=0)
                  bPermition = (BOOL)SendMessage(_hClientWnd, WM_PEGREC_MOUSECLICK, (WPARAM)hWndFgr, MAKELPARAM(_begX, _begY));
               else
                  PostMessage(_hClientWnd, WM_PEGREC_MOUSECLICK, (WPARAM)hWndFgr, MAKELPARAM(_begX, _begY));

			   // simulate a click to the app "below" Transcriber (since we already ate the points)
               if((_iClientFlags&TABLET_NEED_PERMITION)==0 || bPermition)
                  {
                     (*v_pfnCgrPointCallback)(0x07, _begX+1, _begY+1);
                     (*v_pfnCgrPointCallback)(0x0f, _begX, _begY);
                     (*v_pfnCgrPointCallback)(0x0f, _begX, _begY);
                     (*v_pfnCgrPointCallback)(0x0f, _begX, _begY);
                     (*v_pfnCgrPointCallback)(0x0D, _begX, _begY);
                  }
               else
			      {
#ifdef DEBUG2
         OutputDebugString(L"CgrTouch Point 3\n");
#endif
                  return;
				  }
            }

		 // we delay points to see if we should either treat this as a selection or see if 
		 //  we should send the point to the application "underneath" Transcriber,
		 //  or tap and hold.

         // IS INITIAL DELAY?
         if( bNear                                      &&
             Flags==0x0f   /*intermediate point*/       &&
             (_iClientFlags&TABLET_STARTDELAY_TO_SYSTEM)!=0  &&
             (dwTick-begTick>1200 ||
               (dwTick-begTick>dwMinStartDelayTime      &&

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
26uuu亚洲综合色欧美 | 久久影院午夜片一区| 久久综合久久久久88| 国产精品青草久久| 亚洲成av人在线观看| 国产精品一区二区三区四区 | 久久精品国产成人一区二区三区 | 成人欧美一区二区三区| 亚洲第一精品在线| 国产精品18久久久久久久久久久久| 成人avav在线| 欧美大片在线观看一区| 亚洲三级电影全部在线观看高清| 久久成人免费网| 日本韩国一区二区三区| www精品美女久久久tv| 亚洲午夜久久久久| 成人国产精品视频| 日韩欧美国产午夜精品| 亚洲欧美日韩国产综合在线| 精品一区二区三区免费观看| 色成年激情久久综合| 国产欧美日韩综合| 玖玖九九国产精品| 欧美日韩一区二区三区高清| 国产精品女主播在线观看| 美国精品在线观看| 欧美日韩高清一区二区不卡| 最新中文字幕一区二区三区| 国产精品一二三在| 亚洲免费大片在线观看| 国产一区久久久| 欧美成人video| 肉色丝袜一区二区| 欧美日本一区二区三区四区| 亚洲乱码精品一二三四区日韩在线 | 欧美日韩国产色站一区二区三区| 国产精品理论在线观看| 国产成人在线免费观看| 欧美精品一区二区不卡| 久久99热狠狠色一区二区| 91精选在线观看| 婷婷久久综合九色综合伊人色| 91传媒视频在线播放| 亚洲欧洲综合另类| 日本久久电影网| 玉米视频成人免费看| 99久久久久免费精品国产 | 欧美三级三级三级爽爽爽| 亚洲国产人成综合网站| 在线观看国产91| 亚洲国产综合在线| 欧美日本一道本| 日本亚洲三级在线| 欧美tk—视频vk| 国产又黄又大久久| 日本一区二区三区视频视频| 高清在线观看日韩| 亚洲码国产岛国毛片在线| 色天天综合久久久久综合片| 一区二区三区不卡在线观看| 欧美日韩亚洲不卡| 狠狠网亚洲精品| 国产精品视频在线看| 一本大道久久a久久精品综合| 亚洲一区二区高清| 欧美电影免费观看高清完整版在线 | 久久日一线二线三线suv| 成人综合婷婷国产精品久久免费| 亚洲欧洲精品一区二区三区不卡| 在线亚洲一区观看| 老汉av免费一区二区三区 | 欧美日韩一本到| 日韩**一区毛片| 欧美电视剧免费全集观看 | 亚洲一卡二卡三卡四卡| 制服丝袜亚洲网站| 成人综合激情网| 亚洲成人你懂的| 久久久国产一区二区三区四区小说 | 国产专区综合网| 亚洲视频一二区| 日韩一二三区视频| av一区二区三区黑人| 亚洲h精品动漫在线观看| 国产午夜三级一区二区三| 日本精品视频一区二区三区| 理论电影国产精品| 中文字幕亚洲精品在线观看| 狠狠网亚洲精品| 婷婷夜色潮精品综合在线| 欧美一级日韩一级| www.亚洲免费av| 蜜臀久久99精品久久久画质超高清| 国产欧美日韩卡一| 欧美浪妇xxxx高跟鞋交| 丰满少妇久久久久久久| 日韩国产精品久久| 日韩av电影免费观看高清完整版在线观看 | 欧美精品一区二区三区在线播放| 不卡的电影网站| 青青草伊人久久| 一区二区三区中文字幕精品精品| 久久美女艺术照精彩视频福利播放| 欧美亚洲动漫制服丝袜| 成人精品免费网站| 国产中文字幕一区| 美女一区二区视频| 亚洲高清不卡在线| 91在线看国产| 国产精品国模大尺度视频| 欧美一区二区美女| 欧美裸体bbwbbwbbw| 色婷婷国产精品| www.欧美.com| 国产精品夜夜爽| 美女视频第一区二区三区免费观看网站| 亚洲欧美激情小说另类| 国产精品网站在线观看| 久久日韩粉嫩一区二区三区| 日韩一级视频免费观看在线| 欧美系列一区二区| 欧美在线视频全部完| 欧美在线不卡视频| 欧洲色大大久久| 日本道精品一区二区三区| 99re免费视频精品全部| caoporn国产一区二区| 成人av在线资源| av在线播放成人| 91玉足脚交白嫩脚丫在线播放| 风间由美一区二区三区在线观看 | 日韩一区二区三区观看| 欧美一级理论性理论a| 婷婷综合五月天| 亚洲国产wwwccc36天堂| 亚洲丰满少妇videoshd| 亚洲国产精品精华液网站| 亚洲图片欧美综合| 亚洲va天堂va国产va久| 日韩av电影免费观看高清完整版在线观看| 午夜国产不卡在线观看视频| 亚洲国产综合色| 首页亚洲欧美制服丝腿| 老司机免费视频一区二区三区| 激情亚洲综合在线| 粉嫩av亚洲一区二区图片| 99久久久无码国产精品| 91国产免费观看| 在线播放欧美女士性生活| 日韩午夜在线影院| 国产午夜精品一区二区| 亚洲欧洲日产国产综合网| 亚洲一线二线三线久久久| 秋霞电影一区二区| 国产伦精品一区二区三区在线观看| 国产精品18久久久久久久久久久久 | 久久成人久久爱| 国产精品自拍网站| 色悠久久久久综合欧美99| 欧美人与禽zozo性伦| 日韩欧美专区在线| 成人欧美一区二区三区黑人麻豆| 亚洲成人动漫一区| 国产又黄又大久久| 色88888久久久久久影院野外| 91精品一区二区三区久久久久久| 久久久久久97三级| 亚洲一区在线视频观看| 国产福利精品导航| 欧美另类变人与禽xxxxx| 国产欧美日韩在线视频| 午夜久久久久久久久久一区二区| 国产一区91精品张津瑜| 在线免费一区三区| 国产日韩欧美麻豆| 日本亚洲欧美天堂免费| 99国产精品视频免费观看| 日韩欧美一级特黄在线播放| 亚洲视频免费观看| 国产一区中文字幕| 6080国产精品一区二区| 日韩精品一二三区| 国产一区二区三区久久久| 91福利视频网站| 日本一区二区免费在线观看视频| 亚洲国产视频在线| 成人av电影在线| 久久九九久久九九| 蜜桃精品在线观看| 欧美影院精品一区| 亚洲欧美日韩久久| 成人福利在线看| 久久久精品影视| 蜜臀av一区二区| 9191久久久久久久久久久| 一区二区高清免费观看影视大全| 风流少妇一区二区| 国产欧美日韩在线| 国产一区二区精品在线观看|