怎样用API 函数判别 混合键??(如:SHIFT+A  等)

解决方案 »

  1.   

    windows消息中的wparam、lparam就含有这样的附加消息啊。
    要更底层的,调用GetKeyboardState()API吧。
      

  2.   

    用API 函数判别不知道...
     直接用Key的值不好吗?
      

  3.   

    SHORT GetAsyncKeyState(
      int vKey   // virtual-key code
    );
      

  4.   

    接收功能键消息
    WM_SYSKEYDOWN,WM_SYSKEYUP.
    从消息的WPARAM和LPARAM可以判断键值.
      

  5.   

    不必调用api了,delphi已经替你搞定了
    form delphi helpShiftState indicates the state of the Alt, Ctrl, and Shift keys and the mouse buttons.UnitClassestype TShiftState = set of (ssShift, ssAlt, ssCtrl, ssLeft, ssRight, ssMiddle, ssDouble);DescriptionThe TShiftState type is used by key-event and mouse-event handlers to determine the state of the Alt, Ctrl, and Shift keys and the state of the mouse buttons when the event occurs.  It is a set of flags that indicate the following:Value MeaningssShift The Shift key is held down.
    ssAlt The Alt key is held down.
    ssCtrl The Ctrl key is held down.
    ssLeft The left mouse button is held down.
    ssRight The right mouse button is held down.
    ssMiddle The middle mouse button is held down.
    ssDouble The mouse was double-clicked.明白了吧,
    if ssShift then showmessage('shift is down');
      

  6.   

    哈~其实好多问题不一定要靠api来解决的.了解了windows的消息机制可以事半功倍!另外,delphi的帮助感觉很有用,别忘记看啊.(^_^)