Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

koji je kod za neke tastere

[es] :: Pascal / Delphi / Kylix :: koji je kod za neke tastere

[ Pregleda: 1738 | Odgovora: 10 ]

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

dejov
Dejan Jovic
Zrenjanin

Član broj: 17537
Poruke: 88
*.dialup.neobee.net.



Profil

icon koji je kod za neke tastere28.09.2004. u 22:45

ako na dogadjaj npr edit boxa onkeypress zelim da se nesto desi pritiskom na <enter>, tada pisem
Code:
if key=#13 then...

a kako se pise za tastere F1,F2,F3,strelice u levo,desno,gore, dole...
28.09.2004. u 22:45 

filjo

Član broj: 17551
Poruke: 136
*.co.yu



Profil

icon Re: koji je kod za neke tastere28.09.2004. u 23:12
Delphi->Help->Delphi Help->Index->"key codes"
28.09.2004. u 23:12 

dejov
Dejan Jovic
Zrenjanin

Član broj: 17537
Poruke: 88
*.dialup.neobee.net.



Profil

icon Re: koji je kod za neke tastere28.09.2004. u 23:47
da, nasao sam ih sve tamo:
Code:
Virtual Key Code    Corresponding key

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


Naveo sam ih deo, ali sta da napisem
Code:
 if key=key_escape then ...


probao sa ali ne radi. Kako se pise?
28.09.2004. u 23:47 

filjo

Član broj: 17551
Poruke: 136
*.co.yu



Profil

icon Re: koji je kod za neke tastere29.09.2004. u 00:14
Tebi trebaju ovi drugi kodovi otkucaj "virtual key codes". Koristis ih sa vk_escape..., itd.
29.09.2004. u 00:14 

Milos D
Beograd

Član broj: 5621
Poruke: 251
*.ptt.yu



Profil

icon Re: koji je kod za neke tastere29.09.2004. u 08:38
U KeyPress eventu dobijas char parametar i ne mozes da ga poredis sa VK_ESCAPE (Delphi 5) ili KEY_ESCAPE (Delphi 7) jer su to brojevi. Escape je ASCII #27 pa mozes da pitas if key = #27. Mislim da ces dobiti KeyPress event za escape, ali za F1, F2, kursorske i mnoge druge tastere dobijas samo KeyDown i KeyUp. Postavi breakpoint na prvi red KeyPress metode pa ces videti da li se poziva event za odredjeni taster. (Onda postavi mouse pointer na promenljivu "key" pa ces videti i ASCII kod tastera.)
29.09.2004. u 08:38 

slavica2000
Slavica jovanovic
Uzice

Član broj: 31101
Poruke: 50
*.ptt.yu



Profil

icon Re: koji je kod za neke tastere29.09.2004. u 11:11
Za F1 if key=#112 then...
Za F2 if key=#113 then...
vuka
29.09.2004. u 11:11 

bancika
Branislav Stojkovic
Nis, New York

Član broj: 24844
Poruke: 620
213.184.102.*

ICQ: 84215453
Sajt: www.storm-software.co.yu/..


Profil

icon Re: koji je kod za neke tastere29.09.2004. u 19:40
if vk_F1, vk_F2, sto je mozda zgodnije, jer ako stavljas samo #xxx onda ne znas sta znaci :)
Ride the rainbow, crack the sky
29.09.2004. u 19:40 

mrkvojed

Član broj: 38336
Poruke: 30
*.ptt.yu.



Profil

icon Re: koji je kod za neke tastere02.04.2005. u 10:50
- Escape se moze uloviti kao Char , isto kao slova , pomocu
Form eventa OnKeyPress :


if Key = #27 then ...


- Kodove tastera (zasto je Esc = bas 27) mozes dobiti ovako :

procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
Label1.caption := IntToStr(ord(Key));
end;


- Primetices da kad pritisnes F2 ne dobijes nista.


- F2 i sl. se "fataju" pomocu OnKeyDown eventa i virtuelnog koda.
Tada je Key tipa Word :


if (Key = VK_F2) then ...


I ja sam pocetnik, i mene je ovo iritiralo - da ne kazem ...
Ali ovo kod mene radi.

Moze neko iskusan da kaze da li je portabilno, sta je najbolje ...

Pozz svima
02.04.2005. u 10:50 

peromalosutra
Ivan Rajkovic
Banjaluka

Član broj: 54774
Poruke: 402
*.dialup.blic.net.

Jabber: peromalosutra@elitesecurity.org
Sajt: computer-stuff.freehostia..


Profil

icon Re: koji je kod za neke tastere09.04.2005. u 10:49
Najlakse je da napravis program koji ce ti sam racunati kodove pojedinih tastera kao sto je to i mrkvojed predloyio, samo moj program malo drugaciji:

program znak;
uses crt;
var taster:char;
sifra:integer;
begin
repeat
taster:=readkey;
sifra:=ord(taster);
writeln (taster,'=',sifra);
until sifra=27;
end.

:)
ivan@ivan-desktop:~$ ./encrypt.run
*** stack smashing detected ***: ./encrypt.run terminated
Aborted (core dumped)
09.04.2005. u 10:49 

Srki_82
Srdjan Tot
Me @ My Home
Ljubljana

Član broj: 28226
Poruke: 1402
82.208.201.*

ICQ: 246436949


Profil

icon Re: koji je kod za neke tastere10.04.2005. u 02:03
Ovaj... peromalosutra Delphi malo drugacije radi sa virtualnim kodivima karaktera tako da to bas i nece pomoci... tvoj programcic ce recimo kada pritisnes strelicu na gore da vrati dva karaktera, prvi $00, a drugi ne znam tacno... sta ce se desiti kad pritisnes win taster ili popup menu taster?
DirectX na srpskom | GLScene na srpskom

There are only 10 types of people in this world; those who understand binary and those who don't.
10.04.2005. u 02:03 

engineer

Član broj: 45205
Poruke: 106
*.metrohive.neobee.net.



Profil

icon Re: koji je kod za neke tastere10.04.2005. u 09:23
Erm, u Delphi helpu kaže...
Code:
VK_LBUTTON    Left mouse button
VK_RBUTTON    Right mouse button
VK_CANCEL     Control+Break
VK_MBUTTON    Middle mouse button
VK_BACK       Backspace key
VK_TAB        Tab key
VK_CLEAR      Clear key
VK_RETURN     Enter key
VK_SHIFT      Shift key
VK_CONTROL    Ctrl key
VK_MENU       Alt key
VK_PAUSE      Pause key
VK_CAPITAL    Caps Lock key
VK_KANA       Used with IME
VK_HANGUL     Used with IME
VK_JUNJA      Used with IME
VK_FINAL      Used with IME
VK_HANJA      Used with IME
VK_KANJI      Used with IME
VK_CONVERT    Used with IME
VK_NONCONVERT Used with IME
VK_ACCEPT     Used with IME
VK_MODECHANGE Used with IME
VK_ESCAPE     Esc key
VK_SPACE      Space bar
VK_PRIOR      Page Up key
VK_NEXT       Page Down key
VK_END        End key
VK_HOME       Home key
VK_LEFT       Left Arrow key
VK_UP         Up Arrow key
VK_RIGHT      Right Arrow key
VK_DOWN       Down Arrow key
VK_SELECT     Select key
VK_PRINT      Print key (keyboard-specific)
VK_EXECUTE    Execute key
VK_SNAPSHOT   Print Screen key
VK_INSERT     Insert key
VK_DELETE     Delete key
VK_HELP       Help key
VK_LWIN       Left Windows key (Microsoft keyboard)
VK_RWIN       Right Windows key (Microsoft keyboard)
VK_APPS       Applications key (Microsoft keyboard)
VK_NUMPAD0    0 key (numeric keypad)
VK_NUMPAD1    1 key (numeric keypad)
VK_NUMPAD2    2 key (numeric keypad)
VK_NUMPAD3    3 key (numeric keypad)
VK_NUMPAD4    4 key (numeric keypad)
VK_NUMPAD5    5 key (numeric keypad)
VK_NUMPAD6    6 key (numeric keypad)
VK_NUMPAD7    7 key (numeric keypad)
VK_NUMPAD8    8 key (numeric keypad)
VK_NUMPAD9    9 key (numeric keypad)
VK_MULTIPLY   Multiply key (numeric keypad)
VK_ADD        Add key (numeric keypad)
VK_SEPARATOR  Separator key (numeric keypad)
VK_SUBTRACT   Subtract key (numeric keypad)
VK_DECIMAL    Decimal key (numeric keypad)
VK_DIVIDE     Divide key (numeric keypad)
VK_F1         F1 key
VK_F2         F2 key
VK_F3         F3 key
VK_F4         F4 key
VK_F5         F5 key
VK_F6         F6 key
VK_F7         F7 key
VK_F8         F8 key
VK_F9         F9 key
VK_F10        F10 key
VK_F11        F11 key
VK_F12        F12 key
VK_F13        F13 key
VK_F14        F14 key
VK_F15        F15 key
VK_F16        F16 key
VK_F17        F17 key
VK_F18        F18 key
VK_F19        F19 key
VK_F20        F20 key
VK_F21        F21 key
VK_F22        F22 key
VK_F23        F23 key
VK_F24        F24 key
VK_NUMLOCK    Num Lock key
VK_SCROLL     Scroll Lock key
VK_LSHIFT     Left Shift key (only used with GetAsyncKeyState and GetKeyState)
VK_RSHIFT     Right Shift key (only used with GetAsyncKeyState and GetKeyState)
VK_LCONTROL   Left Ctrl key (only used with GetAsyncKeyState and GetKeyState)
VK_RCONTROL   Right Ctrl key (only used with GetAsyncKeyState and GetKeyState)
VK_LMENU      Left Alt key (only used with GetAsyncKeyState and GetKeyState)
VK_RMENU      Right Alt key (only used with GetAsyncKeyState and GetKeyState)
VK_PROCESSKEY Process key
VK_ATTN       Attn key
VK_CRSEL      CrSel key
VK_EXSEL      ExSel key
VK_EREOF      Erase EOF key
VK_PLAY       Play key
VK_ZOOM       Zoom key
VK_NONAME     Reserved for future use
VK_PA1        PA1 key
VK_OEM_CLEAR  Clear key
10.04.2005. u 09:23 

[es] :: Pascal / Delphi / Kylix :: koji je kod za neke tastere

[ Pregleda: 1738 | Odgovora: 10 ]

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.