⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ex3_16.cpp

📁 Wrox.Ivor.Hortons.Beginning.Visual.C.Plus.Plus.2008 With sourcecode
💻 CPP
字号:
// Ex3_16.cpp : main project file.
// Testing key presses in a loop.

#include "stdafx.h"

using namespace System;

int main(array<System::String ^> ^args)
{
  Console::WriteLine(L"Press a key combination - press Escape to quit.");

  ConsoleKeyInfo keyPress;
  do
  {
    keyPress = Console::ReadKey(true);
    Console::Write(L"You pressed");
    if(safe_cast<int>(keyPress.Modifiers)>0)
      Console::Write(L" {0},", keyPress.Modifiers);
    Console::WriteLine(L" {0} which is the {1} character",
                                   keyPress.Key, keyPress.KeyChar);


  }while(keyPress.Key != ConsoleKey::Escape);
  return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -