我知道 上下左右是 VK_UP VK_DOWN VK_LEFT VK_RIGHT但 A,B,C...... F1,F2,......等对应什么, 使用VK_A,VK_B 总是出错.

解决方案 »

  1.   

    对应它的Ascii码啊,如'A'=65 ;'a'=97
      

  2.   

    Key_Escape Escape key
    Key_Tab Tab key
    Key_Backtab, Key_BackTab Backtab key
    Key_Backspace, Key_BackSpace Backspace key
    Key_Return Return key
    Key_Enter Enter key
    Key_Insert Insert key
    Key_Delete Delete key
    Key_Pause Pause key
    Key_Print Print key
    Key_SysReq SysReq key
    Key_Home Home key
    Key_End End key
    Key_Left Left key
    Key_Up Up keyKey_Right Right key
    Key_Down Down key
    Key_Prior  Prior key 
    Key_PageUp Page up key
    Key_Next Next key
    Key_PageDown  Page down key
    Key_Shift Shift key
    Key_Control CTRL key
    Key_Meta Meta key (often this is the same as the Alt key)
    Key_Alt Alt key
    Key_CapsLock Caps Lock key
    Key_NumLock Num Lock key
    Key_ScrollLock Scroll Lock key
    Key_F1 F1 key
    Key_F2 F2 key
    Key_F3 F3 key
    Key_F4 F4 keyKey_F5 F5 key
    Key_F6 F6 key
    Key_F7 F7 key
    Key_F8 F8 key
    Key_F9 F9 key
    Key_F10 F10 key
    Key_F11 F11 key
    Key_F12 F12 key
    Key_F13 F13 key
    Key_F14 F14 key
    Key_F15 F1 key
    Key_F16 F16 key
    Key_F17 F17 key
    Key_F18 F18 key
    Key_F19 F19 key
    Key_F20 F20 key
    Key_F21 F21 key
    Key_F22 F22 key
    Key_F23 F23 key
    Key_F24 F24 key
    Key_F25 F25 key
    Key_F26 F26 key
    Key_F27 F27 key
    Key_F28 F28 key
    Key_F29 F29 key
    Key_F30 F30 key
    Key_F31 F31 key
    Key_F32 F32 keyKey_F33 F33 key
    Key_F34 F34 key
    Key_F35 F35 key
    Key_Super_L Super_L key
    Key_Super_R Super_R key
    Key_Menu Menu key
    Key_Hyper_L Hyper_L key
    Key_Hyper_R Hyper_R key
    Key_Help Help key
    Key_Space, Key_Any Space key
    Key_Exclam Exclamation  key (!)
    Key_QuoteDbl Double quotes key( ?)
    Key_NumberSign Number sign key (#)
    Key_Dollar Dollar sign key ($)
    Key_Percent Percent key (%)
    Key_Ampersand Ampersand key (&)Key_Apostrophe Apostrophe key (?
    Key_ParenLeft Left parenthesis key (
    Key_ParenRight Right parenthesis key )
    Key_Asterisk Asterisk key (*)
    Key_Plus Plus sign key (+)
    Key_Comma Comma key (,)
    Key_Minus Minus sign key (-)
    Key_Period Period key (.)
    Key_Slash Slash key (/)
    Key_0 0 key (numeric keypad)
    Key_1 1 key (numeric keypad)
    Key_2 2 key (numeric keypad)Key_3 3 key (numeric keypad)
    Key_4 4 key (numeric keypad)
    Key_5 5 key (numeric keypad)
    Key_6 6 key (numeric keypad)
    Key_7 7 key (numeric keypad)
    Key_8 8 key (numeric keypad)
    Key_9 9 key (numeric keypad)
    Key_Colon Colon key (:)
    Key_Semicolon Semicolon key (;)
    Key_Less Less than key (<)
    Key_Equal Equal to key (=)
    Key_Greater Greater than key (>)
    Key_Question Question  key (?)Key_At At key @
    Key_A A key
    Key_B B key
    Key_C C key
    Key_D D key
    Key_E E key
    Key_F F key
    Key_G G key
    Key_H H key
    Key_I I key
    Key_J J key
    Key_K K key
    Key_L L key
    Key_M M key
    Key_N N key
    Key_O O key
    Key_P P key
    Key_Q Q key
    Key_R R key
    Key_S S key
    Key_T T key
    Key_U U key
    Key_V V key
    Key_W W key
    Key_X X key
    Key_Y Y key
    Key_Z Z key
    Key_BracketLeft Left bracket key ( [ )
    Key_Backslash Backslash key (\)Key_BracketRight Right bracket key (])
    Key_AsciiCircum Ascii Circum key (^)
    Key_Underscore Underscore key (_)
    Key_QuoteLeft Left quote key (`)
    Key_BraceLeft Left brace key ({)
    Key_Bar Bar key (|)
    Key_BraceRight Right brace key (})
    Key_AsciiTilde Ascii Tilde key (~)
    Key_nobreakspace No break space key (?
    Key_exclamdown Upside down exclamation  key (?
    Key_cent Cent key (? 
    Key_sterling Sterling pound key (? Key_currency Currency key (?
    Key_yen Yen key (?
    Key_brokenbar Broken bar key (? 
    Key_section Section key (?
    Key_diaeresis Diaeresis key (?
    Key_copyright Copyright key (? 
    Key_ordfeminine Feminine key (?
    Key_guillemotleft Left angle quotation  (?
    Key_notsign Not sign key (?
    Key_hyphen Hyphen key (?
    Key_registered Registered key (? 
    Key_macron Macron key (?Key_degree degree key (? 
    Key_plusminus Plus minus key (? 
    Key_twosuperior Superscripted two key (?
    Key_threesuperior Superscripted three key (?
    Key_acute Acute key (?
    Key_mu Mu key (?
    Key_paragraph Paragraph key (?
    Key_periodcentered Centered period key (?
    Key_cedilla Cedilla key (?
    Key_onesuperior Superscripted one key (?
    Key_masculine Masculine key (?Key_guillemotright Right angle quotation  (?
    Key_onequarter One-quarter key (?
    Key_onehalf One-half key (?
    Key_threequarters Three-quarters key (?
    Key_questiondown Upside down question  key (?
    Key_Agrave A grave key (?
    Key_Aacute A acute key (?
    Key_Acircumflex A circumflex key (?
    Key_Atilde A tilde key (?Key_Adiaeresis A diaeresis key (?
    Key_Aring A ring key (?
    Key_AE AE key (?
    Key_Ccedilla C cedilla key (?
    Key_Egrave E grave key (?
    Key_Eacute E acute key (?
    Key_Ecircumflex E circumflex key (?
    Key_Ediaeresis E diaeresis key (?
    Key_Igrave I grave key (?
    Key_Iacute I acute key (?
    Key_Icircumflex I circumflex key (?Key_Idiaeresis I diaeresis key (?
    Key_ETH ETH key (?
    Key_Ntilde N tilde key (? 
    Key_Ograve O grave key (?
    Key_Oacute O acute key (?
    Key_Ocircumflex O circumflex key (?
    Key_Otilde O tilde key (?
    Key_Odiaeresis O diaeresis key (?
    Key_multiply Multiply key (?
    Key_Ooblique O oblique key (?
    Key_Ugrave U grave key (?Key_Uacute U acute key (?
    Key_Ucircumflex U circumflex key (? 
    Key_Udiaeresis U diaeresis key (?
    Key_Yacute Y acute key (?
    Key_ssharp S sharp key (?
    Key_agrave a grave key (?
    Key_aacute a acute key (?
    Key_acircumflex a circumflex key (?
    Key_atilde a tilde key (?
    Key_adiaeresis a diaeresis key (?Key_aring a ring key (?
    Key_ae Ae key (?
    Key_ccedilla c cedilla key (?
    Key_egrave e grave key (?
    Key_eacute e acute key (?
    Key_ecircumflex e circumflex key (?
    Key_ediaeresis e diaeresis key (?
    Key_igrave i grave key (?
    Key_iacute i acute key (?
    Key_icircumflex i circumflex key (?
    Key_idiaeresis i diaeresis key (?Key_eth eth key (?
    Key_ntilde n tilde key (?
    Key_ograve o grave key (?
    Key_oacute o acute key (?
    Key_ocircumflex o circumflex key (?
    Key_otilde o tilde key (?
    Key_odiaeresis o diaeresis key (?
    Key_division Division sign key (?
    Key_oslash o slash key (?
    Key_ugrave u grave key (?
    Key_uacute u acute key (?Key_ucircumflex u circumflex key (?
    Key_udiaeresis u diaeresis key (?
    Key_yacute y acute key (?
    Key_thorn Thorn key (?
    Key_ydiaeresis y diaeresis key ()
    Key_unknown Unknown key
      

  3.   

    还是不对呀:
               if key=Key_Up then            //有错误
                  showmessage('dddddddddd');
               if key=vk_up then             //正确
                  showmessage('dddddddddd');
               if key=vk_w then              //有错误
                   showmessage('dddddddddd');
      

  4.   

    知道了,要加  use QT.