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

Вниз

VCL: (ssCtrl in shift); KOL: ?   Найти похожие ветки 

 
Revolter   (2003-09-17 15:05) [0]

в VCL обработчик события нажатие клавиши Ctrl: (ssCtrl in shift), а как в KOL?


 
Gandalf ©   (2003-09-20 10:31) [1]

Можно так:

procedure TForm1.ListBox1KeyDown(Sender: PControl; var Key: Integer;
 Shift: Cardinal);
begin
 if (Shift and 4)=4 then
 begin
   ListBox1.Items[0]:="Shift +";
 end
 else
 begin
   ListBox1.Items[0]:="Shift -";
 end;

 if (Shift and 8)=8 then
 begin
   ListBox1.Items[1]:="Ctrl +";
 end
 else
 begin
   ListBox1.Items[1]:="Ctrl -";
 end;

 if (Shift and 32)=32 then
 begin
   ListBox1.Items[2]:="Alt +";
 end
 else
 begin
   ListBox1.Items[2]:="Alt -";
 end;

end;


 
Revolter   (2003-09-20 18:46) [2]

как сложно, однако..

спасибо


 
Gandalf ©   (2003-09-20 20:14) [3]

На самом деле можешь скажем сделать так:

TShiftStates=(ssRes1,ssRes2,ssShift,ssCtrl,ssRes3,ssAlt);
TShiftState=set of TShiftStates;

Ну и привидя тип TShiftState(Shift) можешь работать как с множеством.

(ssCtrl in TShiftState(shift))



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

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

Наверх




Память: 0.47 MB
Время: 0.033 c
3-1080388803
TGrey
2004-03-27 15:00
2004.04.25
Почему SQL запрос к Access работает не верно?


1-1081251006
Aleksandr
2004-04-06 15:30
2004.04.25
Если я назначаю событие Application.OnException, как оно с try..?


1-1081417361
Марат
2004-04-08 13:42
2004.04.25
Дата и время


1-1081276571
GRF
2004-04-06 22:36
2004.04.25
Как принудительно вызвать событие OnSelectCell в StringGrid


14-1080634026
Фикус
2004-03-30 12:07
2004.04.25
Вопрос по Excel