#include <string>
#include <iostream>
#include "windows.h"
#include <conio.h>
#include <time.h>
#include "stdio.h"
using namespace std; int main()
{
char old;
while(1){
char c = getch();
if (c == 'q'){
char cc;
do{
system("cls");
printf("are you sure to quit?(y/n)");
cc = getch();
printf("++%c",cc);
}
while(cc != 'y' && cc !='n');
printf("q cc=%c\n", cc);
if(cc == 'y'){
break;
}
else{
printf("q_old = %c\n", old);
}
}
system("cls");
printf("%c\n", c);
old = c;
printf("old=%c\n",old);
}
return 0;
}

http://blog.csdn.net/zz457887107/article/details/6612034

c++ get keyboard event的更多相关文章

  1. [AngularJS Unit tesint] Testing keyboard event

    HTML: <div ng-focus="vm.onFocus(month)", aria-focus="{{vm.focus == month}}", ...

  2. [转]How WebKit’s Event Model Works

    原文:https://homes.cs.washington.edu/~burg/projects/timelapse/articles/webkit-event-implementation/ Fi ...

  3. [Angular] Angular Global Keyboard Handling With EventManager

    If we want to add global event handler, we can use 'EventManager' from '@angular/platform-broswer'. ...

  4. 解密jQuery事件核心 - 委托设计(二)

    第一篇 http://www.cnblogs.com/aaronjs/p/3444874.html 从上章就能得出几个信息: 事件信息都存储在数据缓存中 对于没有特殊事件特有监听方法和普通事件都用ad ...

  5. JavaScipt 事件体系

    事件机制 jQuery对事件的绑定分别有几个API .bind()/.live()/.delegate()/.on() 不管是用什么方式绑定,归根到底还是用addEventListener/attac ...

  6. wpf键盘记录器

    很简单的一个wpf键盘记录器 这个程序我一样用了全局勾子,之前用的都是winform上运行了,前一段时间 在国外的论坛上逛看到了一个wpf能用的就做了一个小程序记录一下,为了方便大家直关的看我在页面上 ...

  7. Hooks——钩子概览

    (资料源于MSDN,本文仅对其进行翻译.批注.其链接为:http://msdn.microsoft.com/en-us/library/windows/desktop/ms644959%28v=vs. ...

  8. GWT事件处理

    package com.zly.client; import com.google.gwt.core.client.EntryPoint; import com.google.gwt.event.do ...

  9. OPENCV

    opencv_ts300.libopencv_world300.lib IlmImfd.lib libjasperd.liblibjpegd.liblibpngd.lib libtiffd.lib l ...

随机推荐

  1. HTML+CSS设计个人主页

    在个人主页的设计中,我采用了圣代布局和div分块.效果图如下: <!DOCTYPE html> <html lang="en"> <head> ...

  2. CentOS7下编译安装redis-5.0.9

    CentOS7下编译安装redis-5.0.9 本文地址http://yangjianyong.cn/?p=171转载无需经过作者本人授权 下载redis #code start wget https ...

  3. 用Python实现童年的21款小游戏,有你玩过的吗?(不要错过哦)

    Python为什么能这么火热,Python相对于其他语言来说比较简单,即使是零基础的普通人也能很快的掌握,在其他方面比如,处于灰色界的爬虫,要VIP的视频,小说,歌,没有爬虫解决不了的:数据挖掘及分析 ...

  4. PHP的可变变量与可变函数

    什么叫可变.在程序世界中,可变的当然是变量.常量在定义之后都是不可变的,在程序执行过程中,这个常量都是不能修改的.但是变量却不同,它们可以修改.那么可变变量和可变函数又是什么意思呢?很明显,就是用另一 ...

  5. javascript 关闭当前页面

    1. 不带任何提示关闭窗口的js代码 <a href="javascript:window.opener=null;window.open('','_self');window.clo ...

  6. SpringBoot之SpringSecurity权限注解在方法上进行权限认证多种方式

    前言 Spring Security支持方法级别的权限控制.在此机制上,我们可以在任意层的任意方法上加入权限注解,加入注解的方法将自动被Spring Security保护起来,仅仅允许特定的用户访问, ...

  7. SQL Server 命令备忘录(持续更新...)

    1.删除表内容并重置ID truncate table 表名 2.开启SqlDependency监控数据库 在数据中执行以下查询: SELECT is_broker_enabled FROM sys. ...

  8. Oracle配置tcps加密协议

    1.Oracle用户下操作,创建证书 mkdir /home/oracle/wallet orapki wallet create -wallet "/home/oracle/wallet& ...

  9. 使用python -m pip install 和 pip install 安装包有什么区别?

    如果去看源码的话,你会发现 pip 作为执行文件的入口点是 pip._internal.main. 另一方面,pip 作为模块运行时入口是 _main.py,而该模块也只是调用 pip.interna ...

  10. 你了解一条sql的执行顺序吗

    sql是后端开发人员经常碰到的问题,我们经常会写这样的sql:select name,id from student where id=12 order by id desc,把这条sql放到数据库中 ...