Heim >Web-Frontend >js-Tutorial >Javascript-KeyCode-Enzyklopädie

Javascript-KeyCode-Enzyklopädie

伊谢尔伦
伊谢尔伦Original
2016-11-22 14:49:561909Durchsuche

Tastencode    8 = BackSpace BackSpace
Tastencode   9 = Tab Tab
Tastencode   12 = Löschen
Tastencode   13 = Eingabe
Tastencode   16 = Shift_L
Tastencode   17 = Strg_L
Tastencode   18 = Alt_L
Tastencode   19 = Pause
Tastencode   20 = Feststelltaste
Tastencode   27 = Escape Escape
Tastencode   32 = Leertaste Leertaste
Tastencode   33 = Vorherige
Tastencode   34 = Weiter
Tastencode   35 = Ende
Tastencode   36 = Startseite
Tastencode   37 = Links
Tastencode   38 = Aufwärts
Tastencode   39 = Rechts
Tastencode   40 = Abwärts
Tastencode   41 = Auswählen
Tastencode   42 = Drucken
Tastencode   43 = Ausführen
Tastencode   45 = Einfügen
Tastencode   46 = Löschen
Tastencode   47 = Hilfe
Tastencode   48 = 0 gleich Klammerrechts
Tastencode   49 = 1 Ausrufezeichen onesuperior
Schlüsselcode   50 = 2 quotedbl twosuperior
Schlüsselcode   51 = 3 Abschnitt dreisuperior
Schlüsselcode   52 = 4 Dollar
Schlüsselcode   53 = 5 Prozent
Schlüsselcode   54 = 6 kaufmännisches Und
Schlüsselcode   55 = 7 Schrägstrich nach links
Tastencode   56 = 8 parenlinke Klammer links
Tastencode   57 = 9 parallele rechte Klammerrechte
Tastencode   65 = a A
Tastencode   66 = b B
Tastencode   67 = c C
Tastencode   68 = d D
Schlüsselcode   69 = e E EuroSign
Schlüsselcode   70 = f F
Schlüsselcode   71 = g G
Schlüsselcode   72 = h H
Schlüsselcode   73 = i I
Schlüsselcode   74 = j J
Schlüsselcode   75 = k K
Schlüsselcode   76 = l L
Schlüsselcode   77 = m M mu
Schlüsselcode   78 = n N
Schlüsselcode   79 = o O
Schlüsselcode   80 = p P
Schlüsselcode 81 = q Q at
Tastencode   82 = r R
Tastencode   83 = s S
Tastencode   84 = t T
Tastencode   85 = u U
Tastencode   86 = v V
Tastencode   87 = w W
Tastencode   88 = x KP_2
Tastencode   99 = KP_3 KP_3
Tastencode 100 = KP_4 KP_4
Tastencode 101 = KP_5 KP_5
Tastencode 102 = KP_6 KP_6
Tastencode 103 = KP_7 KP_7
Tastencode. 104 = KP_8 KP_8
Tastencode 105 = KP_9 KP_9
Tastencode 106 = KP_Multiply KP_Multiply
Tastencode 107 = KP_Add KP_Add
Tastencode 108 = KP_Separator KP_Separator
Tastencode 109 = KP_Subtract
Taste Code 110 = KP_Decimal KP_Decimal
Tastencode 111 = KP_Divide KP_Divide
Tastencode 112 = F1
Tastencode 113 = F2
Tastencode 114 = F3
Tastencode 115 = F4
Tastencode 116 = F5
Tastencode 117 = F6
Tastencode 118 = F7
Tastencode 119 = F8
Tastencode 120 = F9
Tastencode 121 = F10
Tastencode 122 = F11
Tastencode 123 = F12
Tastencode 124 = F13
Tastencode 125 = F14
Tastencode 126 = F15
Tastencode 127 = F16
Tastencode 128 = F17
Tastencode 129 = F18
Tastencode 130 = F19
Tastencode 131 = F20
Tastencode 132 = F21
Tastencode 133 = F22
Tastencode 134 = F23
Tastencode 135 = F24
Tastencode 136 = Num_Lock
Tastencode 137 = Scroll_Lock
Tastencode 187 = akutes Grab
Tastencode 188 = Komma Semikolon
Tastencode 189 = Minus-Unterstrich
Tastencode 190 = Punkt Doppelpunkt
Tastencode 192 = Nummernzeichen-Apostroph
Tastencode 210 = Plusminus-Bindestrich-Makron
Tastencode 211 =
Tastencode 212 = Urheberrecht registriert
Schlüsselcode 213 = guillemotleft guillemotright
Schlüsselcode 214 = maskulin ordfeminine
Schlüsselcode 215 = ae AE
Schlüsselcode 216 = Cent Yen
Schlüsselcode 217 = questionsdown exclamdown
Schlüsselcode 218 = onequarter onehalf threequarters
Tastencode 220 = kleinerer großer Strich
Tastencode 221 = Plus-Sternchen-Asciitilde
Tastencode 227 = Division multiplizieren
Tastencode 228 = Acircumflex Acircumflex
Tastencode 229 = Ecircumflex Ecircumflex
Tastencode 230 = Icircumflex Icircumflex
Tastencode 231 = ocircumflex Ocircumflex
Tastencode 232 = ucircumflex Ucircumflex
Tastencode 233 = ntilde Ntilde
Tastencode 234 = yacute Yacute
Tastencode 235 = oslash Ooblique
Tastencode 236 = aring Aring
Schlüsselcode 237 = ccedilla Ccedilla
Schlüsselcode 238 = Thorn THORN
Schlüsselcode 239 = eth ETH
Schlüsselcode 240 = diaeresis cedilla Währung
Schlüsselcode 241 = agrave Agrave atilde Atilde
Schlüsselcode 242 = egrave Egrave
Schlüsselcode 243 = Igrave Igrave
Schlüsselcode 244 = Ograve Otilde Otilde
Schlüsselcode 245 = Ugrave Ugrave
Schlüsselcode 246 = Adiaeresis Adiaeresis
Schlüsselcode 248 = Idiaeresis
Schlüsselcode 249 = Odiaeresis Odiaeresis
Schlüsselcode 250 = Udiaeresis Udiaeresis
Schlüsselcode 251 = scharfer Frage-Backslash
Schlüsselcode 252 = Asciicircum-Grad
Schlüsselcode 253 = 3 Sterling
Schlüsselcode 254 = Mode_switch

Verwendungsbeispiel:

$(window).keydown(function(event){
  switch(event.keyCode) {
    // ...
    // 不同的按键可以做不同的事情
    // 不同的浏览器的keycode不同
    // 更多详细信息:     http://unixpapa.com/js/key.html
  }
});

Für bestimmte Formularelemente:

$("#Post_tags").keydown(function(event){
    switch(event.keyCode){
        case 13:
            alert(this.value);
            break;
    }
});

Zuvor müssen Sie die Formular-Senden-Schaltfläche binden. Das kann sein Wird normalerweise nur verwendet, wenn das onKeyDown-Ereignis entfernt wird. Andernfalls wird der js-Code ausgeführt und das Formular gesendet:

, ändern Sie

<input type=submit>

in

<input type=button onclick="javascript:if(confirm(&#39;ok&#39;)){this.form.submit();}">

.


Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn