zoukankan      html  css  js  c++  java
  • ReadKey Test Program

    The following program tests ReadKey by waiting for a keypress and then reporting whether or not the CapsLock key is down. Note that, you must include a delay factor when calling ReadKey to allow time for MS-Windows to process its message loop:

    Table 1: keyboard Control Key State Values.

    Value

    Meaning

    CAPSLOCK_ON

    The CAPS LOCK light is on.

    ENHANCED_KEY

    The key is enhanced.

    LEFT_ALT_PRESSED

    The left ALT key is pressed.

    LEFT_CTRL_PRESSED

    The left CTRL key is pressed.

    NUMLOCK_ON

    The NUM LOCK light is on.

    RIGHT_ALT_PRESSED

    The right ALT key is pressed.

    RIGHT_CTRL_PRESSED

    The right CTRL key is pressed.

    SCROLLLOCK_ON

    The SCROLL LOCK light is on.

    SHIFT_PRESSED

    The SHIFT key is pressed.

       TITLE Testing ReadKey (TestReadkey.asm)
    INCLUDE Irvine32.inc
    INCLUDE Macros.inc
    .code
    main PROC
    L1: mov eax,10 ; delay for msg processing
    call Delay
    call ReadKey ; wait for a keypress
    jz L1
    test ebx,CAPSLOCK_ON
    jz L2
    mWrite <"CapsLock is ON",0dh,0ah>
    jmp L3
    L2: mWrite <"CapsLock is OFF",0dh,0ah>
    L3: exit
    main ENDP
    END main 
  • 相关阅读:
    C++ 虚成员函数和动态联编
    C++ 多态公有继承
    C++ 继承特性
    C++ 公有派生
    C++ 基类与派生类
    C++ 类继承
    C++ 伪私有方法
    C++ new失败
    mysql用户授权
    linux时间设置
  • 原文地址:https://www.cnblogs.com/dreamafar/p/5978590.html
Copyright © 2011-2022 走看看