Вниз
Скачать: 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.955 c
4-1137144109
Andrey C
2006-01-13 12:21
2006.04.02
Програмный клик мышки


2-1142764813
sco
2006-03-19 13:40
2006.04.02
Полоса прокрутки


15-1141896338
Зм1й
2006-03-09 12:25
2006.04.02
Проблемы с локалкой


2-1142955037
имя
2006-03-21 18:30
2006.04.02
ListBox


3-1139373952
apl
2006-02-08 07:45
2006.04.02
Список таблиц в базе данных




   Наверх