Вниз
Скачать: CL | DM;

KOL - 2.10 - KeyPreview   Найти похожие ветки 

← →
raskin ©   (2005-08-10 21:30) [0]

В Kol 2.10 мне не удалось по умолчанию настроить KeyPreview в PAS_VERSION  (FPC, KOL для Delphi, Win98). Предлагаю следующее изменение: в TControl.WndProc, проверку FHandle=GetFocus() не производить, если сообщение WM_KEYDOWN (эта проверка введена для WM_KEYUP, судя по комментариям). Возможно, как я пока сделал, для надёжности добавить переменную типа longint с именем KeyPreviewCounter и перед передачей с 3960? й строки ParentForm.Perform, увеличивать KeyPreviewCounter, а при обработке TControl.WndProc в случае FHandle<>GetFocus() уменьшать KeyPreviewCounter (если он положителен) и поступать по-старому (прекращать обработку), если он 0


← →
thaddy   (2005-08-10 23:13) [1]

You can simply handle WM_KEYUP in a global OnMessage handler.
If you set result:=true, the key is silenty removed:

Like:
function TForm1.DoMessage(var Msg:TMsg;var Rslt:integer):Boolean;
begin
 Result:=false;
 // ignore escape
 if (msg.message = WM_KEYUP) and (msg.wparam = VK_ESCAPE) then result:=true;
end;


← →
raskin ©   (2005-08-11 13:08) [2]

Really I"ve no problem with Redundant WM_KEUP"s, but the problem was with the KeyPreviewing. I"ve found the solution that "works for me", but found it useful to share found information - I hope it"llbe useful for everyone to know about the problem (and the way to solve it).



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

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.053 c
2-1142886765
Luarv
2006-03-20 23:32
2006.04.02
Удалить элемент ФАЙЛА


15-1141897687
iamdanil
2006-03-09 12:48
2006.04.02
PATH environment variable


15-1141991242
Mystic
2006-03-10 14:47
2006.04.02
Давно веток про магию не было...


3-1139213959
Afanasiy
2006-02-06 11:19
2006.04.02
Delphi 5 &amp; ADO


2-1142605589
Fenix
2006-03-17 17:26
2006.04.02
Как можно в Data засунуть мою структуру?




   Наверх