• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ ReadKey函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中ReadKey函数的典型用法代码示例。如果您正苦于以下问题:C++ ReadKey函数的具体用法?C++ ReadKey怎么用?C++ ReadKey使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了ReadKey函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: Key

void Key()
{
	char keyvalue;
	keyvalue=ReadKey();
	if(keyvalue!=0x00)
	{
		keyvalue=ReadKey();
		while(ReadKey()!=0x00){}
	}
	if(keyvalue!=0x00)
	{
		switch(keyvalue)	//只处理单个键按下的情况,多个键按下不识别,当作没有键按下
		{
			case 0x01:KeyNum=1;break;
			case 0x02:KeyNum=2;break;
			case 0x04:KeyNum=3;break;
			case 0x08:KeyNum=4;break;
			case 0x10:KeyNum=5;break;
			case 0x20:KeyNum=6;break;
			case 0x40:KeyNum=7;break;
			case 0x80:KeyNum=8;break;
			default:KeyNum=0;break;
		}
	}
	else KeyNum=0;
	if(KeyNum==3) Count++;
	else if(KeyNum==7) Count--;
	else{}
}
开发者ID:ktboy0502,项目名称:mcu485,代码行数:29,代码来源:Key.c


示例2: ReadKey

void CSTMInput::ReadKeys()
{
  ReadKey(KEY_JOYSTICK_SEL);
  ReadKey(KEY_JOYSTICK_UP);
  ReadKey(KEY_JOYSTICK_DOWN);
  ReadKey(KEY_JOYSTICK_LEFT);
  ReadKey(KEY_JOYSTICK_RIGHT);
}
开发者ID:KHIEM2812,项目名称:auto_quad_fc,代码行数:8,代码来源:CSTMInput.cpp


示例3: Mass_Storage_Start

/*******************************************************************************
* Function Name  : Mass_Storage_Start
* Description    : Starts the mass storage demo.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void Mass_Storage_Start (void)
{
  /* Disble the JoyStick interrupts */
  IntExtOnOffConfig(DISABLE);

  /* Clear the LCD screen */
  LCD_Clear(White);

  LCD_SetDisplayWindow(160, 223, 128, 128);
 
  LCD_DrawBMP(0x00647C00);

  /* Disable LCD Window mode */
  LCD_WindowModeDisable();
  
  /* Set the Back Color */
  LCD_SetBackColor(Blue);
  /* Set the Text Color */
  LCD_SetTextColor(White); 

  if(MSD_Init() != 0x00)
  {
    LCD_DisplayStringLine(Line8, " No MSD Card Present");
    LCD_DisplayStringLine(Line9, "  To exit Press SEL ");

    /* Loop until SEL key pressed */
    while(ReadKey() != SEL)
    {
    }
  }
  else
  {
    Get_Medium_Characteristics();

    /* Display the "  Plug the USB   " message */
    LCD_DisplayStringLine(Line8, " Plug the USB Cable ");
    LCD_DisplayStringLine(Line9, "Exit:  Push JoyStick");
    
    /* Intialize the USB cell */
    USB_Init();
  
    LCD_ClearLine(Line9);
    /* Display the "To stop Press SEL" message */
    LCD_DisplayStringLine(Line8, "  To stop Press SEL ");

    /* Loop until SEL key pressed */
    while(ReadKey() != SEL)
    {
    }

    PowerOff();
  }
  LCD_Clear(White);
  DisplayMenu();
  IntExtOnOffConfig(ENABLE);
  /* Flush SPI1 Data Register */
  SPI_I2S_ReceiveData(SPI1);
}
开发者ID:siriusJinwooChoi,项目名称:Microprocessor-Project,代码行数:65,代码来源:mass_storage.c


示例4: DHCPReadConfig

// read configuration either from INI file (if it exists) or from the registry
int DHCPReadConfig ( )
{
int   Ark;
char szBuf[128];

   memset (& sParamDHCP, 0, sizeof sParamDHCP);
   sParamDHCP.nLease = DHCP_DEFAULT_LEASE_TIME;

   for (Ark=0 ; Ark<SizeOfTab (tDHCPd32Entry) ; Ark++)
        ReadKey (  TFTPD32_DHCP_KEY, 
                   tDHCPd32Entry [Ark].szEntry,
                   tDHCPd32Entry [Ark].pValue,
                   tDHCPd32Entry [Ark].nBufSize,
                   tDHCPd32Entry [Ark].nType,
                   szTftpd32IniFile );
    // custom items
   for (Ark=0 ; Ark < SizeOfTab (sParamDHCP.t) ; Ark++)
   {
      wsprintf (szBuf, "%s%d", KEY_DHCP_USER_OPTION_NB, Ark+1);
      ReadKey  (TFTPD32_DHCP_KEY, szBuf, & sParamDHCP.t[Ark].nAddOption, 
                sizeof sParamDHCP.t[Ark].nAddOption, REG_DWORD, szTftpd32IniFile);

       wsprintf (szBuf, "%s%d", KEY_DHCP_USER_OPTION_VALUE, Ark+1);
       ReadKey  (TFTPD32_DHCP_KEY,  szBuf, sParamDHCP.t[Ark].szAddOption, 
                 sizeof sParamDHCP.t[Ark].szAddOption, REG_SZ, szTftpd32IniFile);
   }

   if ( sParamDHCP.nPoolSize!=0 )
   {
	  tFirstIP = malloc (sParamDHCP.nPoolSize * sizeof *tFirstIP[0]) ;
	  tMAC = malloc (sParamDHCP.nPoolSize * sizeof *tMAC[0]) ; 
	  if (tFirstIP == NULL  ||  tMAC == NULL ) 
	   {
			SVC_ERROR ("Can not allocate memory");
			return FALSE;
	   }
	   LoadLeases ();
   }

   if (sParamDHCP.nLease==0)
   {  
      sParamDHCP.nLease=DHCP_DEFAULT_LEASE_TIME;
      LOG (12, "%d, Lease time not specified, set to 2 days", GetCurrentThreadId ());
   }
   // compatability 3 -> 4
   if (sParamDHCP.szWins[0]==0  && sParamDHCP.szDns1[0]!=0)
   {
      lstrcpy (sParamDHCP.szWins, sParamDHCP.szDns1);
      LOG (0, "WINS server copied from DNS servers");
   }

return TRUE;
} // DHCPReadConfig
开发者ID:julchar,项目名称:tftpd-64,代码行数:54,代码来源:bootpd_util.c


示例5: Proc_TP_Adj

char Proc_TP_Adj(char *NC)
{
  unsigned int temp[8]                               ;
  Color     = Green                                  ;
  Color_BK  = Black                                  ;
  TP_Init()                                          ;
  Clear_LCD(Color_BK)                                ; 
  PutStringCN24(58,120,"触摸屏校正")                 ;
  Color     = Cyan                                   ;
  PutStringCN16(30,165,"请用触控笔点测试点中心")     ;
  for(;;)
  {
    Draw_Test_Point(20,20,Yellow)                    ;
    for(;;)
    {
      if(Read_TP_Twice(&temp[0],&temp[1]))  break    ;
      if(ReadKey()==Cancel)  return 0x00             ;
    }
    DrawRectFill(0,0,40,40,Color_BK)                 ;
    Wait_Pen_Up()                                    ;
  
    Draw_Test_Point(220,20,Yellow)                   ;
    for(;;)
    {
      if(Read_TP_Twice(&temp[2],&temp[3]))  break    ;
      if(ReadKey()==Cancel)  return 0x00             ;
    }
    DrawRectFill(200,0,40,40,Color_BK)               ;
    Wait_Pen_Up()                                    ;
    
    Draw_Test_Point(20,300,Yellow)                   ;
    for(;;)
    {
      if(Read_TP_Twice(&temp[4],&temp[5]))  break    ;
      if(ReadKey()==Cancel)  return 0x00             ;
    }
    DrawRectFill(0,280,40,40,Color_BK)               ;
    Wait_Pen_Up()                                    ;
    
    Draw_Test_Point(220,300,Yellow)                  ;
    for(;;)
    {
      if(Read_TP_Twice(&temp[6],&temp[7]))  break    ;       
      if(ReadKey()==Cancel)  return 0x00             ;
    }
    DrawRectFill(200,280,40,40,Color_BK)             ;
    Wait_Pen_Up()                                    ;
    if(TP_Adjust(temp))         break                ;
  }
  return 0x00                                        ;
}
开发者ID:sdlylshl,项目名称:DK5438_example,代码行数:51,代码来源:main.c


示例6: MASS_init

/*******************************************************************************
* Function Name  : MASS_init
* Description    : Mass Storage init routine.
* Input          : None.
* Output         : None.
* Return         : None.
*******************************************************************************/
void MASS_init()
{
  pInformation->Current_Configuration = 0;

  /* Connect the device */
  PowerOn();

  /* USB interrupts initialization */
  /* clear pending interrupts */
  _SetISTR(0);
  wInterrupt_Mask = IMR_MSK;
  /* set interrupts mask */
  _SetCNTR(wInterrupt_Mask);
  pInformation->Current_Feature = MASS_ConfigDescriptor[7];

  /* Wait until device is configured */
  while (pInformation->Current_Configuration == 0)
  {
    NOP_Process();
    if(ReadKey() != NOKEY)
    {
      return;
    }
  }
  bDeviceState = CONFIGURED;
}
开发者ID:siriusJinwooChoi,项目名称:Microprocessor-Project,代码行数:33,代码来源:usb_prop.c


示例7: Tftpd32ReadSettings

/////////////////////////////////////////////////////////
// Read settings :
// Parse the settings table and call ReadKey
/////////////////////////////////////////////////////////
BOOL Tftpd32ReadSettings (void)
{
int Ark, Rc=TRUE;
char szCurDir[_MAX_PATH];
   for (Ark=0 ;   Ark< SizeOfTab (tTftpd32Entry) ;   Ark++)
     ReadKey (   TFTPD32_MAIN_KEY, 
                 tTftpd32Entry[Ark].szEntry,
                 tTftpd32Entry[Ark].pValue,
                 tTftpd32Entry[Ark].nBufSize,
                 tTftpd32Entry[Ark].nType,
                 szTftpd32IniFile );
  if (sSettings.uServices == TFTPD32_NONE)  sSettings.uServices = TFTPD32_ALL_SERVICES;
  
    // field WorkingDirectory : 
    // try env variable then szBaseDir and current dir
    if (    GetEnvironmentVariable (TFTP_DIR, szCurDir, sizeof szCurDir) != 0 
         && IsValidDirectory ( szCurDir ) )
                GetFullPathName ( szCurDir, 
                                  sizeof sSettings.szWorkingDirectory,
                                  sSettings.szWorkingDirectory, 
                                  NULL );
    else if ( IsValidDirectory ( sSettings.szBaseDirectory ) )
                GetFullPathName ( sSettings.szBaseDirectory, 
                                  sizeof sSettings.szWorkingDirectory,
                                  sSettings.szWorkingDirectory, 
                                  NULL );
    else        GetCurrentDirectory ( sizeof sSettings.szWorkingDirectory,
                                       sSettings.szWorkingDirectory );
// release for the Australian Department of defence
#ifdef BAE_SYSTEMS_LEN_WHITE
  sSettings.uServices = TFTPD32_TFTP_SERVER;
#endif
return Rc;
} // Tftpd32ReadSettings
开发者ID:madnessw,项目名称:thesnow,代码行数:38,代码来源:settings.c


示例8: main

int main(int argc, char **argv)
{
	FILE *f;
	double atk,def;
	int t=0;
	
	InitSystem();
	
	Bpp=4;
	XRes=800+XR; YRes=400; 

	ScreenBuf=(unsigned char*)malloc(XRes*YRes*Bpp);
	memset(ScreenBuf,0,XRes*YRes*Bpp);
	InitSDL();	
	
	while (1)
	{
		int Ch=ReadKey();
		
		if (Ch=='q') exit(0);
		Iterate();
		Survey(&atk,&def);
		
		f=fopen("output.txt","a");
		fprintf(f,"%d %.6g %.6g\n",t,atk,def);
		fclose(f);
		t++;
	}
}
开发者ID:ModelingOriginsofLife,项目名称:Guttenberg-model,代码行数:29,代码来源:foodchain.cpp


示例9: Alarm_Adjust

/*******************************************************************************
* Function Name  : Alarm_Adjust
* Description    : Adjusts an alarm event to occurs within the current day.
* Input          : None
* Output         : None
* Return         : None
*******************************************************************************/
void Alarm_Adjust(void)
{
  /* Disable the JoyStick interrupts */
  IntExtOnOffConfig(DISABLE);

  while(ReadKey() != NOKEY)
  {
  }
  
  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
  /* Clear the LCD screen */
  LCD_Clear(White);

  LCD_SetDisplayWindow(160, 223, 128, 128);
 
  LCD_NORDisplay(ALARM_ICON);
  RCC_AHBPeriphClockCmd(RCC_AHBPeriph_FSMC, ENABLE);
  /* Disable LCD Window mode */
  LCD_WindowModeDisable();
  
  Alarm_PreAdjust();

  /* Clear the LCD */
  LCD_Clear(White);
  /* Display the menu */
  DisplayMenu();
  /* Enable the JoyStick interrupts */
  IntExtOnOffConfig(ENABLE);  
}
开发者ID:freemanqiu,项目名称:STM3210E_Demo,代码行数:36,代码来源:calendar.c


示例10: GetVisItInstallationDirectory

std::string
GetVisItInstallationDirectory(const char *version)
{
#if defined(_WIN32)
    // Get the installation dir for the specified from the registry.
    char *visitHome = 0;
    std::string installDir("C:\\");
    if(ReadKey(version, "VISITHOME", &visitHome) == 1)
    {
        installDir = visitHome;
    }
    else
    {
        // try the environment
        const std::string idir = Environment::get("VISITHOME");
        if (!idir.empty())
        {
            installDir = idir;
        }
        else
        {
            // get the path for this process
            char tmpdir[MAX_PATH];
            if (GetModuleFileName(NULL, tmpdir, MAX_PATH) != 0)
            {
                std::string visitpath(tmpdir);
                size_t lastSlash = visitpath.rfind("\\");
                if(lastSlash != std::string::npos)
                    installDir = visitpath.substr(0, lastSlash);
                else
                    installDir = visitpath;
            }
        }
    }
    if (visitHome != 0)
        free(visitHome);
    return installDir;
#else
    // Get the installation dir for the version that's running. They all use
    // the same "visit" script so it's okay to do this.
    std::string installDir("/usr/local/visit");
    const std::string idir = Environment::get("VISITHOME");
    if(!idir.empty())
    {
        if(isDevelopmentVersion)
            installDir = idir;
        else
        {
            // The directory often has a "/bin" on the end. Strip it off.
            std::string home(idir);
            int lastSlash = home.rfind("/");
            if(lastSlash != -1)
                installDir = home.substr(0, lastSlash);
            else
                installDir = idir;
        }
    }
    return installDir;
#endif
}
开发者ID:HarinarayanKrishnan,项目名称:VisIt28RC_Trunk,代码行数:60,代码来源:InstallationFunctions.C


示例11: GetDiscKey

bool CDVDSession::GetDiscKey()
{
    if (m_session == DVD_END_ALL_SESSIONS) {
        return false;
    }

    BYTE DiscKeys[2048];
    if (!ReadKey(DvdDiskKey, DiscKeys)) {
        return false;
    }

    for (int i = 0; i < g_nPlayerKeys; i++) {
        for (int j = 1; j < 409; j++) {
            BYTE DiscKey[6];
            memcpy(DiscKey, &DiscKeys[j * 5], 5);
            DiscKey[5] = 0;

            CSSdisckey(DiscKey, g_PlayerKeys[i]);

            BYTE Hash[6];
            memcpy(Hash, &DiscKeys[0], 5);
            Hash[5] = 0;

            CSSdisckey(Hash, DiscKey);

            if (!memcmp(Hash, DiscKey, 6)) {
                memcpy(m_DiscKey, DiscKey, 6);
                return true;
            }
        }
    }

    return false;
}
开发者ID:hiplayer,项目名称:mpc_hc,代码行数:34,代码来源:VobFile.cpp


示例12: _QuerySaveState

STATIC int _QuerySaveState(void)
{
     _UpdateInterfaceState();
     
     while (KeyPressed())
     {
        if (ReadKey() == STOPKEY)
        {
           UnLockMouse();
           DrawFunctionKey(1, "help");
           if (QueryUserStop())
           {
              StopDefragmentationProcess(); /* Just sets a variable in
                                               main\actions.c           */
              LockMouse(1, 1, 80, 25);
              DrawFunctionKey(3, "stop");
              return TRUE;
           }
           else
           {
              LockMouse(1, 1, 80, 25);
              DrawFunctionKey(3, "stop");
              return FALSE;
           }
        }
     }

     return FALSE;
}
开发者ID:CivilPol,项目名称:sdcboot,代码行数:29,代码来源:ovlimpl.c


示例13: ReadData

int Bitmaps::ReadData()
{
	this->GetSquareSize();
	int start = this->_squareSize / 2;

	if (!ReadKey())
	{
		printf("invalid key\n");
		return 0;
	}
	ReadOne();

	int i = start*4;
	int a;
	int r;
	int b;
	int g;
	r = b = g = -1;
	for(a=0;a<this->_n_squares;a++)
	{
		r = this->_data[i+2];
		g = this->_data[i+1];
		b = this->_data[i];
		//printf("Read data = R:%d G:%d B:%d\n",r,g,b);
		i = i + this->_squareSize *4;
	}
	return a;
}
开发者ID:scouratier,项目名称:advil,代码行数:28,代码来源:bitmaps.cpp


示例14: GTIFImport

int GTIFImport(GTIF *gtif, GTIFReadMethod scan,void *aux)
{
    int status;
    char message[1024];

    if (!scan) scan = (GTIFReadMethod) &DefaultRead;
    if (!aux) aux=stdin;

    scan(message,aux);
    if (strncmp(message,FMT_GEOTIFF,8)) return 0;
    scan(message,aux);
    if (!sscanf(message,FMT_VERSION,(short int*)&gtif->gt_version)) return 0;
    scan(message,aux);
    if (sscanf(message,FMT_REV,(short int*)&gtif->gt_rev_major,
               (short int*)&gtif->gt_rev_minor) !=2) return 0;

    scan(message,aux);
    if (strncmp(message,FMT_TAGS,8)) return 0;
    while ((status=ReadTag(gtif,scan,aux))>0);
    if (status < 0) return 0;

    scan(message,aux);
    if (strncmp(message,FMT_KEYS,8)) return 0;
    while ((status=ReadKey(gtif,scan,aux))>0);

    return (status==0); /* success */
}
开发者ID:drownedout,项目名称:datamap,代码行数:27,代码来源:geo_print.c


示例15: ManualClockCalibration

/**
  * @brief  Calibration of External crystal oscillator manually
  * @param  None
  * @retval : None
  */
void ManualClockCalibration(void)
{
  UpDownIntOnOffConfig(ENABLE);
  RightLeftIntExtOnOffConfig(ENABLE);
  SelIntExtOnOffConfig(DISABLE);
  LCD_Clear(Blue2);
  BKP_TamperPinCmd(DISABLE);
  BKP_RTCOutputConfig(BKP_RTCOutputSource_CalibClock);
  LCD_DisplayString(Line1,Column5,"Calibration");
  LCD_DisplayString(Line3,Column0,"LSE/64 is available");
  LCD_DisplayString(Line4,Column0,"on PC13.Measure the");
  LCD_DisplayString(Line5,Column0,"the frequency and");
  LCD_DisplayString(Line6,Column0,"press Sel to proceed");
  
  while(ReadKey()!=SEL)
  {
  }
  
  LCD_Clear(Blue2);
  BKP_RTCOutputConfig(BKP_RTCOutputSource_None);
  LCD_DisplayString(Line1,Column4,"Please enter");
  LCD_DisplayString(Line2,Column2,"Calibration Value");
  LCD_DisplayCount(Line4,Column6,1,ArrayTime[0]+0x30);
  LCD_DisplayCount(Line4,Column7,0,ArrayTime[1]+0x30);
  LCD_DisplayCount(Line4,Column8,0,ArrayTime[2]+0x30);
  LCD_DisplayString(Line6,Column6,"(0-121)");
  LCD_SetBackColor(Green);
  SelIntExtOnOffConfig(ENABLE);
}
开发者ID:namnguyendsn,项目名称:jupiter_packet,代码行数:34,代码来源:clock_calendar.c


示例16: ReadDigit

/**
  * @brief  Reads digit entered by user, using menu navigation keys.
  * @param  None
  * @retval Digit value
  */
uint8_t ReadDigit(uint16_t LineBegin, uint16_t ColBegin, uint8_t CountBegin, uint8_t ValueMax, uint8_t ValueMin)
{
  uint8_t tmpValue = 0;
  Button_TypeDef keystate = (Button_TypeDef)10;

  /* Set the Back Color */
  LCD_SetBackColor(LCD_COLOR_RED);

  /* Set the Text Color */
  LCD_SetTextColor(LCD_COLOR_WHITE);

  /* Initialize tmpValue */
  tmpValue = CountBegin;

  /* Display  */
  LCD_DisplayChar(LineBegin, ColBegin, (tmpValue + 0x30));

  /* Endless loop */
  while(1)
  {
    /* Get the Joytick State */
    keystate = ReadKey();

    /* If "BUTTON_TAMPER" push button is pressed */
    if(keystate == BUTTON_TAMPER)
    {
      /* Increase the value of the digit */
      if(tmpValue == ValueMax)
      {
        tmpValue = (ValueMin - 1);
      }
      /* Display new value */
      LCD_DisplayChar(LineBegin, ColBegin,((++tmpValue) + 0x30));
    }
    /* If "BUTTON_WAKEUP" push button is pressed */
    if(keystate == BUTTON_WAKEUP)
    {
      /* Decrease the value of the digit */
      if(tmpValue == ValueMin)
      {
        tmpValue = (ValueMax + 1);
      }
      /* Display new value */
      LCD_DisplayChar(LineBegin, ColBegin,((--tmpValue) + 0x30));
    }
    /* If "BUTTON_KEY" push button is pressed */
    if(keystate == BUTTON_KEY)
    {
      /* Set the Back Color */
      LCD_SetBackColor(LCD_COLOR_WHITE);
      /* Set the Text Color */
      LCD_SetTextColor(LCD_COLOR_RED);
      /* Display new value */
      LCD_DisplayChar(LineBegin, ColBegin, (tmpValue + 0x30));
      /* Return the digit value and exit */
      return tmpValue;
    }
  }
}
开发者ID:szymon2103,项目名称:Stm32,代码行数:64,代码来源:main.c


示例17: GetKey

unsigned int GetKey(void) {
 unsigned int c;
 unsigned int r;
 c=(unsigned int)ReadKey();
 if (!c) return 0;
 r=(c&0x80)?0x80000000:0;
 c&=~0x80;
 if (c>=2 && c<=11)
   c=keys0[c-2];
 else if (c>=15 && c<=27) 
   c=keys1[c-15];
 else if (c>=30 && c<=40) 
   c=keys2[c-30];
 else if (c>=44 && c<=53) 
   c=keys3[c-44];
 else 
  switch (c) {
   case 57: c=' '; break;
   case 77: c=KEY_RIGHTARROW; break;
   case 75: c=KEY_LEFTARROW; break;
   case 72: c=KEY_UPARROW; break;
   case 80: c=KEY_DOWNARROW; break;
   case 1: c=KEY_ESCAPE; break;
   case 28: c=KEY_ENTER; break;
   case 9: c=KEY_TAB; break;
   case 58: c=KEY_CAPSLOCK; break;
   case 59: c=KEY_F1; break;
   case 60: c=KEY_F2; break;
   case 61: c=KEY_F3; break;
   case 62: c=KEY_F4; break;
   case 63: c=KEY_F5; break;
   case 64: c=KEY_F6; break;
   case 65: c=KEY_F7; break;
   case 66: c=KEY_F8; break;
   case 67: c=KEY_F9; break;
   case 68: c=KEY_F10; break;
   case 87: c=KEY_F11; break;
   case 88: c=KEY_F12; break;
   case 14: c=KEY_BACKSPACE; break;
   case 69: c=KEY_PAUSE; break;
   case 13: c=KEY_EQUALS; break;
   case 12: c=KEY_MINUS; break;
   case 42: c=KEY_RSHIFT; break;
   case 29: c=KEY_RCTRL; break;
   case 56: c=KEY_RALT; break;
   case 0x35: c=KEY_FIVE; break;
   case 0x36: c=KEY_SIX; break;
   case 0x37: c=KEY_SEVEN; break;
//   case 0x38: c=KEY_EIGHT; break;
//   case 0x39: c=KEY_NINE; break;
   case 0x30: c=KEY_ZERO; break;
   case 0x5C: c=KEY_BACKSLASH; break;
   case 71: c=KEY_HOME; break;
   case 79: c=KEY_END; break;
   case 73: c=KEY_PGUP; break;
   case 81: c=KEY_PGDN; break;
  }
 return (c|r);   
}
开发者ID:droozynuu,项目名称:hexen-for-android,代码行数:59,代码来源:i_fbsdvideo.c


示例18: CSSkey1

bool CDVDSession::Authenticate()
{
    if (m_session == DVD_END_ALL_SESSIONS) {
        return false;
    }

    BYTE Challenge[10], Key[10];

    for (BYTE i = 0; i < 10; i++) {
        Challenge[i] = i;
    }

    if (!SendKey(DvdChallengeKey, Challenge)) {
        return false;
    }

    if (!ReadKey(DvdBusKey1, Key)) {
        return false;
    }

    int varient = -1;

    for (int i = 31; i >= 0; i--) {
        BYTE KeyCheck[5];
        CSSkey1(i, Challenge, KeyCheck);
        if (!memcmp(KeyCheck, Key, 5)) {
            varient = i;
        }
    }

    if (!ReadKey(DvdChallengeKey, Challenge)) {
        return false;
    }

    CSSkey2(varient, Challenge, &Key[5]);

    if (!SendKey(DvdBusKey2, &Key[5])) {
        return false;
    }

    CSSbuskey(varient, Key, m_SessionKey);

    return true;
}
开发者ID:hiplayer,项目名称:mpc_hc,代码行数:44,代码来源:VobFile.cpp


示例19: ReadDigit

/*******************************************************************************
* Function Name  : ReadDigit
* Description    : Reads digit entered by user, using menu navigation keys.
* Input          : None
* Output         : None
* Return         : Digit value
*******************************************************************************/
uint8_t ReadDigit(uint8_t ColBegin, uint8_t CountBegin, uint8_t ValueMax, uint8_t ValueMin)
{
  uint32_t MyKey = 0, tmpValue = 0;

  /* Set the Back Color */
  LCD_SetBackColor(Red);
  /* Set the Text Color */
  LCD_SetTextColor(White);

  /* Initialize tmpValue */
  tmpValue = CountBegin;
  /* Display  */
  LCD_DisplayChar(Line8, ColBegin, (tmpValue + 0x30));

  /* Endless loop */
  while(1)
  {
    /* Check which key is pressed */
    MyKey = ReadKey();

    /* If "UP" pushbutton is pressed */
    if(MyKey == UP)
    {
      /* Increase the value of the digit */
      if(tmpValue == ValueMax)
      {
        tmpValue = (ValueMin - 1);
      }
      /* Display new value */
      LCD_DisplayChar(Line8, ColBegin,((++tmpValue) + 0x30));
    }
    /* If "DOWN" pushbutton is pressed */
    if(MyKey == DOWN)
    {
      /* Decrease the value of the digit */
      if(tmpValue == ValueMin)
      {
        tmpValue = (ValueMax + 1);
      }
      /* Display new value */
      LCD_DisplayChar(Line8, ColBegin,((--tmpValue) + 0x30));
    }
    /* If "SEL" pushbutton is pressed */
    if(MyKey == SEL)
    {
      /* Set the Back Color */
      LCD_SetBackColor(White);
      /* Set the Text Color */
      LCD_SetTextColor(Red);
      /* Display new value */
      LCD_DisplayChar(Line8, ColBegin, (tmpValue + 0x30));
      /* Return the digit value and exit */
      return tmpValue;
    }
  } 
}
开发者ID:freemanqiu,项目名称:STM3210E_Demo,代码行数:63,代码来源:calendar.c


示例20: KeyUp

int KeyUp(ALLEGRO_EVENT *toEvent)
{
    int nTecla = 0;

    if (toEvent->type == ALLEGRO_EVENT_KEY_UP)
    {
        nTecla = ReadKey(toEvent->keyboard.keycode);
    }
    return nTecla;
}
开发者ID:rodrigo-mendonca,项目名称:Desenvolvimento,代码行数:10,代码来源:Events.c



注:本文中的ReadKey函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ ReadLine函数代码示例发布时间:2022-05-30
下一篇:
C++ ReadInt32函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap