Delphi --- Hiiri
// nuolinäppäimet käyttöön
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case Key of
VK_UP: begin
Edit1.Text := 'ylänuoli';
end;
VK_DOWN: begin
Edit1.Text := 'alanuoli';
end;
VK_LEFT: begin
Edit1.Text := 'vasennuoli';
end;
VK_Right: begin
Edit1.Text := 'oikeanuoli';
end;
end;//case
end;
// Hiiren koordinaatit näytetään ainoastaan imagen päällä!
// Formille laitettu StatusBar-komponentti joka ensin jaetaan kahteen osaan.
// Laitetaan formille myös image-komponentti jonka OnMouseMove tapahtumakäsittelijään
// kirjoitetaan:
procedure TForm1.Image1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
begin
// Ohjataan koordinaatit StatusBar:in ekalohkoon, tsekkaa miten pilkku näytetään
StatusBar1.Panels[0].Text := IntToStr(X)+','+IntToStr(Y);
end;
28.12.2000
Virtuaaliset näppäimistökoodit:
| VK_LBUTTON | Hiiren
vasen nappi |
| VK_RBUTTON | Hiiren oikea nappi |
| VK_MBUTTON | Hiiren keskimmäinen nappi |
| VK_CANCEL | Break-näppäin |
| VK_BACK | Peruutus-näppäin (Backspace) |
| VK_TAB | Sarkain (Tab) näppäin |
| VK_CLEAR | Clear
näppäin |
| VK_RETURN | Enter näppäin |
| VK_SHIFT | Vaihto (Shift) näppäin |
| VK_CONTROL | Ctrl
näppäin |
| VK_MENU | Alt näppäin |
| VK_PAUSE | Pause näppäin |
| VK_CAPITAL | Caps
Lock näppäin |
| 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 näppäin |
| VK_SPACE | Välilyönti näppäin |
| VK_PRIOR | Page Up näppäin |
| VK_NEXT | Page
Down näppäin |
| VK_END | End näppäin |
| VK_HOME | Home näppäin |
| VK_LEFT | Vasen-nuoli
näppäin |
| VK_UP | Ylänuoli näppäin |
| VK_RIGHT | Oikeanuoli näppäin |
| VK_DOWN | Alanuoli
näppäin |
| VK_SELECT | Select näppäin |
| VK_PRINT | Print (keyboard-specific) |
| VK_EXECUTE | Execute
näppäin |
| VK_SNAPSHOT | Print Screen näppäin |
| VK_INSERT | Insert näppäin |
| VK_DELETE | Delete
näppäin |
| VK_HELP | Help näppäin |
| VK_LWIN | Left Windows key (Microsoft keyboard) |
| VK_RWIN | Right Windows key (Microsoft keyboard) |
| VK_APPS | Applications
key (Microsoft keyboard) |
| VK_NUMPAD0 | Numeronäppäimistön
0 |
| VK_NUMPAD1 | Numeronäppäimistön 1 |
| VK_NUMPAD2 | Numeronäppäimistön 2 |
| VK_NUMPAD3 | Numeronäppäimistön 3 |
| VK_NUMPAD4 | Numeronäppäimistön
4 |
| VK_NUMPAD5 | Numeronäppäimistön 5 |
| VK_NUMPAD6 | Numeronäppäimistön 6 |
| VK_NUMPAD7 | Numeronäppäimistön 7 |
| VK_NUMPAD8 | Numeronäppäimistön
8 |
| VK_NUMPAD9 | Numeronäppäimistön 9 |
| VK_MULTIPLY | Numeronäppäimistön kerto-näppäin |
| VK_ADD | Numeronäppäimistön plus-näppäin |
| VK_SEPARATOR | Numeronäppäimistön erotin-näppäin |
| VK_SUBTRACT | Numeronäppäimistön miinus-näppäin |
| VK_DIVIDE | Numeronäppäimistön jako-näppäin |
| VK_DECIMAL | Numeronäppäimistön desimaali-näppäin |
| VK_F1 | F1 näppäin |
| VK_F2 | F2
näppäin |
| VK_F3 | F3 näppäin |
| VK_F4 | F4 näppäin |
| VK_F5 | F5
näppäin |
| VK_F6 | F6 näppäin |
| VK_F7 | F7 näppäin |
| VK_F8 | F8
näppäin |
| VK_F9 | F9 näppäin |
| VK_F10 | F10 näppäin |
| VK_F11 | F11 näppäin |
| VK_F12 | F12 näppäin |
| VK_F13 | F13 näppäin |
| VK_F14 | F14 näppäin |
| VK_F15 | F15 näppäin |
| VK_F16 | F16 näppäin |
| VK_F17 | F17 näppäin |
| VK_F18 | F18 näppäin |
| VK_F19 | F19 näppäin |
| VK_F20 | F20 näppäin |
| VK_F21 | F21 näppäin |
| VK_F22 | F22 näppäin |
| VK_F23 | F23 näppäin |
| VK_F24 | F24 näppäin |
| VK_NUMLOCK | Num Lock näppäin |
| VK_SCROLL | Scroll Lock näppäin |
| 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 |