Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2002.03.21;
Скачать: CL | DM;

Вниз

Как узнать код комбинации Alt+Enter?   Найти похожие ветки 

 
user_   (2002-03-07 08:45) [0]

Мне надо в KeyDown инициировать какое-нибудь событие по нажатию


 
Alx2 ©   (2002-03-07 08:51) [1]

Заголовок обработчика выглядит так
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
Из Shift: TShiftState можно узнать нажат ли alt.
Вот цитата из help:

Description

The TShiftState type is used by key-event and mouse-event handlers to determine the state of the Alt, Ctrl, and Shift keys and the state of the mouse buttons when the event occurred. It is a set of flags that indicate the following:

Value Meaning

ssShift The Shift key is held down.
ssAlt The Alt key is held down.
ssCtrl The Ctrl key is held down.
ssLeft The left mouse button is held down.
ssRight The right mouse button is held down.
ssMiddle The middle mouse button is held down.
ssDouble The mouse was double-clicked.


 
Alx2 ©   (2002-03-07 08:55) [2]


procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if (ssAlt in Shift) and (key=13) then
Нажато Alt+Enter!
end;


 
Юрий Зотов ©   (2002-03-07 11:44) [3]

Неточно.

if (ssAlt in Shift) and (key=13) then
Нажато Alt+Enter
и, возможно, еще Shift
и/или еще Ctrl
и/или еще одна из клавиш мыши
и/или еще сделан двойной щелчок

А вот

if (Shift = [ssAlt]) and (key=13) then
Нажато Alt+Enter и ничего больше


 
Alx2 ©   (2002-03-07 11:50) [4]

>Юрий Зотов © (07.03.02 11:44)
отмазка, конечно, но я же не пишу, что нажато ТОЛЬКО Alt+Enter.
Но Alt+Enter нажато точно :))



Страницы: 1 вся ветка

Текущий архив: 2002.03.21;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.008 c
14-67007
Blackweber
2002-02-06 02:15
2002.03.21
Для тех кто учился(учится) в Питере.


1-66846
galy
2002-03-05 11:08
2002.03.21
Delphi глючит или я? Помогите разобраться.


3-66769
Markov D.
2002-02-21 19:00
2002.03.21
Midas / SocketConnection


3-66723
volodya_
2002-02-20 11:43
2002.03.21
Помогите с кодировкой


7-67022
nika_rgups
2001-12-18 21:00
2002.03.21
MP3 coder