星期三, 3月 31, 2010

javascript keycode

Key Codes


This document is written by Helge Willum Larsen
It contains a list of all "onkeypress", "onkeydown" and "onkeyup" KeyCodes in JavaScript,
that can be typed with a DANISH KEYBOARD !!!
Other keyboards probably have other KeyCodes.

The first section is tested with the Microsoft Internet Explore 5.0 and the Netscape
Communicator 4.51. At this time, Netscape didn't support "onkeydown" and "onkeyup".

I strongly recommend that you use the "onkeypress" function.
It has the greatest browser-compatibility.
Otherwise, you can maybe use some of the codes in the bottom of the page:


____________________________________________________________________________________________

KeyCodes (ALL keyboards): onkeypress  Tested with Internet Explore 5.0
By: Helge Willum Larsen     and Netscape Communicator 4.51
       on a DANISH keyboard
____________________________________________________________________________________________

SUPPORTS MULTIPLE KEYPRESSES:
                       [A] = [a]
             [Shift] + [A] = [A]
          [CapsLock] + [A] = [A]
[Shift] + [CapsLock] + [A] = [a]

ALL KEYS THAT CREATES THE SAME OUTPUT, HAVE THE SAME KEYCODES !

[NumPad 1] is the same as [1] (if NumLock)
[NumPad +] is the same as [+]

DOES NOT SUPPORT ARROW-KEYS, DELETE, INSERT, SHIFT, ALT, CTRL, TAB, ESC...........!
But it supports [Return / Enter] and [Backspace]
____________________________________________________________________________________________


Button:   keyCode:

[BackSpace]    8

[Return / Enter]  13

[!]    33
["]    34
[#]    35
[$]    36
[%]    37
[&]    38
[']    39
[(]    40
[)]    41
[*]    42
[+]    43
[,]    44
[-]    45
[.]    46
[/]    47
[0]    48
[1]    49
[2]    50
[3]    51
[4]    52
[5]    53
[6]    54
[7]    55
[8]    56
[9]    57
[:]    58
[;]    59
[<]    60
[=]    61
[>]    62
[?]    63
[@]    64
[A]    65
[B]    66
[C]    67
[D]    68
[E]    69
[F]    70
[G]    71
[H]    72
[I]    73
[J]    74
[K]    75
[L]    76
[M]    77
[N]    78
[O]    79
[P]    80
[Q]    81
[R]    82
[S]    83
[T]    84
[U]    85
[V]    86
[W]    87
[X]    88
[Y]    89
[Z]    90
[[]    91
[\]    92
[]]    93
[^]    94
[_]    95
[`]    96
[a]    97
[b]    98
[c]    99
[d]   100
[e]   101
[f]   102
[g]   103
[h]   104
[i]   105
[j]   106
[k]   107
[l]   108
[m]   109
[n]   110
[o]   111
[p]   112
[q]   113
[r]   114
[s]   115
[t]   116
[u]   117
[v]   118
[w]   119
[x]   120
[y]   121
[z]   122
[{]   123
[|]   124
[}]   125
[~]   126

[£]   163
[¤]   164

[§]   167
[¨]   168

[´]   180

[½]   189

[Å]   197
[Æ]   198

[Ø]   216

[å]   229
[æ]   230

[ø]   248










____________________________________________________________________________________________

KeyCodes (DANISH keyboard): onkeydown / onkeyup Tested with Internet Explore 5.0)
By: Helge Willum Larsen
____________________________________________________________________________________________

DOES NOT SUPPORT MULTIPLE KEYPRESSES !

ALL KEYS HAVE THEIR OWN, INDIVIDUAL KEYCODE !

[NumPad 1] is NOT the same as [1]
[NumPad +] is NOT the same as [+]
____________________________________________________________________________________________


Button:   keyCode: NumLock: CapsLock: ScrollLock:

[BackSpace]    8  -  -  -
[Tab]     9  -  -  -

[NumPad 5]   12  no  -  -
[Return / Enter]  13  -  -  -

[Shift]    16  -  -  -
[Ctrl]    17  -  -  -
[Alt]    18  -  -  -
[Pause / Break]   19  -  -  -
[CapsLock]   20  -  -  -

[Esc]    27  -  -  -

[Space]    32  -  -  -
[Page Up]   33  -  -  -
[Page Down]   34  -  -  -
[End]    35  -  -  -
[Home]    36  -  -  -
[LeftArrow]   37  -  -  -
[UpArrow]   38  -  -  -
[RightArrow]   39  -  -  -
[DownArrow]   40  -  -  -

[PrintScreen / SysRq]  44  -  -  -
[Insert]   45  -  -  -
[Delete]   46  -  -  -

[0]    48  -  -  -
[1]    49  -  -  -
[2]    50  -  -  -
[3]    51  -  -  -
[4]    52  -  -  -
[5]    53  -  -  -
[6]    54  -  -  -
[7]    55  -  -  -
[8]    56  -  -  -
[9]    57  -  -  -

[A]    65  -  -  -
[B]    66  -  -  -
[C]    67  -  -  -
[D]    68  -  -  -
[E]    69  -  -  -
[F]    70  -  -  -
[G]    71  -  -  -
[H]    72  -  -  -
[I]    73  -  -  -
[J]    74  -  -  -
[K]    75  -  -  -
[L]    76  -  -  -
[M]    77  -  -  -
[N]    78  -  -  -
[O]    79  -  -  -
[P]    80  -  -  -
[Q]    81  -  -  -
[R]    82  -  -  -
[S]    83  -  -  -
[T]    84  -  -  -
[U]    85  -  -  -
[V]    86  -  -  -
[W]    87  -  -  -
[X]    88  -  -  -
[Y]    89  -  -  -
[Z]    90  -  -  -

[Turn Off] (special)  94  -  -  -
[Sleep] (special)  95  -  -  -
[NumPad 0]   96  yes  -  -
[NumPad 1]   97  yes  -  -
[NumPad 2]   98  yes  -  -
[NumPad 3]   99  yes  -  -
[NumPad 4]  100  yes  -  -
[NumPad 5]  101  yes  -  -
[NumPad 6]  102  yes  -  -
[NumPad 7]  103  yes  -  -
[NumPad 8]  104  yes  -  -
[NumPad 9]  105  yes  -  -
[NumPad *]  106  -  -  -
[NumPad +]  107  -  -  -
[NumPad -]  109  -  -  -
[NumPad ,]  110  -  -  -
[NumPad /]  111  -  -  -
[F1]   112  -  -  -
[F2]   113  -  -  -
[F3]   114  -  -  -
[F4]   115  -  -  -
[F5]   116  -  -  -
[F6]   117  -  -  -
[F7]   118  -  -  -
[F8]   119  -  -  -
[F9]   120  -  -  -
[F10]   121  -  -  -
[F11]   122  -  -  -
[F12]   123  -  -  -

[NumLock]  144  -  -  -
[ScrollLock]  145  -  -  -

[+] (next to [0]) 187  -  -  -
[,]   188  -  -  -
[-] (next to [.]) 189  -  -  -
[.]   190  -  -  -

[Æ]   192  -  -  -

[´] (next to [+]) 219  -  -  -
[½] (next to [1]) 220  -  -  -
[Å]   221  -  -  -
[Ø]   222  -  -  -

[<] (next to [Z]) 226  -  -  -

[Wake Up] (special) 255  -  -  -

____________________________________________________________________________________________





____________________________________________________________________________________________

Functions:      Tested with Internet Explore 5.0
By: Helge Willum Larsen     and Netscape Communicator 4.51
____________________________________________________________________________________________
Number:

 
String:

沒有留言:

張貼留言

留個話吧:)

其他你感興趣的文章

Related Posts with Thumbnails