Welcome

Welcome, thanks to look my blog

Tuesday 1 April 2014

daftar kode ASCII ( kode angka keyboard



daftar kode ASCII ( kode angka keyboard


8    Backspace
9    Tab
13    Enter
16    Shift
17    Ctrl
18    Menu
20    CapsLock
27    Esc
32    Space
33    Page Up
34    Page down
35    end
36    home
37    Left
38    Up
39    Right
40    Down
46    Del
47    Help
144    NumLock
65    A
66    B
67    C
68    D
69    E
70    F
71    G
72    H
73    I
74    J
75    K
76    L
77    M
78    N
79    O
80    P
81    Q
82    R
83    S
84    T
85    U
86    V
87    W
88    X
89    Y
90    Z
48    0
49    1
50    2
51    3
52    4
53    5
54    6
55    7
56    8
57    9
96    0
97    1
98    2
99    3
100    4
101    5
102    6
103    7
104    8
105    9
106    *
107    +
108    Enter
109    -
110    .
111    Division Sign (/)
112    F1
113    F2
114    F3
115    F4
116    F5
117    F6
118    F7
119    F8
120    F9
121    F10
122    F11
123    F12


Apa itu ASCII ?

ASCII (American Standard Code For Information Interchange) merupakan kode standar yang digunakan dalam pertukaran informasi pada Komputer. Kode ASCII ini seperti Hex dan Unicode tetnamunapi ASCII lebih bersifat universal.

Jumlah kode ASCII adalah 255 kode.
Kode ASCII 0 - 127 merupakan kode ASCII untuk manipulasi teks
kode ASCII 128 - 255 merupakan kode ASCII untuk manipulasi grafik.

Kode ASCII sendiri dapat dikelompokkan lagi kedalam beberapa bagian :
  • Kode yang tidak terlihat simbolnya seperti :
          Kode 10 (Line Feed)
          Kode 13 (Carriage Return)
          Kode 8 (Tab)
          Kode 32 (Space)
  • Kode yang terlihat simbolnya seperti abjad (A..Z), numerik (0..9), karakter khusus (~!@#$%^&*()_+?:”{})
  • Kode yang tidak ada di keyboard namun dapat ditampilkan. Kode ini umumnya untuk kode-kode grafik.
Kode ASCII ini digunakan oleh komputer dan alat komunikasi lain untuk menunjukkan teks. Kode ASCII sebenarnya memiliki komposisi bilangan biner sebanyak 8 bit. Dimulai dari 0000 0000 hingga 1111 1111.

Tak perlu bertele-tele langsung saja buat programnya.. :D
  • Tambahkan 2 Label pada Form
  • Seting Properties Form KeyPreview menjadi TRUE
  • Pada Form Event OnKeyDown,masukkan source code berikut :

  1. procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;  
  2.   
  3.   Shift: TShiftState);  
  4.   
  5. begin  
  6.   
  7. Label1.Caption:= IntToStr(Key);  
  8.   
  9. end;  

Source Code Lengkap :

  1. unit Unit1;  
  2.   
  3.   
  4.   
  5. interface  
  6.   
  7.   
  8.   
  9. uses  
  10.   
  11.   Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,  
  12.   
  13.   Dialogs, StdCtrls;  
  14.   
  15.   
  16.   
  17. type  
  18.   
  19.   TForm1 = class(TForm)  
  20.   
  21.     Label1: TLabel;  
  22.   
  23.     Label2: TLabel;  
  24.   
  25.     procedure FormKeyDown(Sender: TObject; var Key: Word;  
  26.   
  27.       Shift: TShiftState);  
  28.   
  29.   private  
  30.   
  31.     { Private declarations }  
  32.   
  33.   public  
  34.   
  35.     { Public declarations }  
  36.   
  37.   end;  
  38.   
  39.   
  40.   
  41. var  
  42.   
  43.   Form1: TForm1;  
  44.   
  45.   
  46.   
  47. implementation  
  48.   
  49.   
  50.   
  51. {$R *.dfm}  
  52.   
  53.   
  54.   
  55. procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;  
  56.   
  57.   Shift: TShiftState);  
  58.   
  59. begin  
  60.   
  61. Label1.Caption:= IntToStr(Key);  
  62.   
  63. end;  
  64.   
  65.   
  66. end.  

Hasil Sreenshot Program :

ascii_tombol


No comments:

Post a Comment