Home
Top.Mail.Ru Yandeks.Metrika
Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Down

How to make TEdit not generate a beep when the keystroke handler is on. Find similar branches


voronkov   (2001-12-18 12:27) [0]

I tired this trabl and I do not know how to fight. In TEdit, I use the OnKeyDown keystroke handler. I catch keystrokes like Enter, Escape and others. After pressing these keys, a beep sounds. If there is a sound card, then the signal from the sound scheme set, if not, then the computer speaker works. Users howl, I sit with them, howl too. Climbing inside computers and cutting off the speakers seems to me unsporting. How to trample it?



Anatoly Podgoretsky   (2001-12-18 12:34) [1]

Key: = # 0



Anatoly Podgoretsky   (2001-12-18 12:36) [2]

Sorry, I thought about OnKeyPress



Виктор Щербаков   (2001-12-18 12:42) [3]

And what about OnKeyDown? Recently there was the same problem.
I had to use RichEdit.



Владислав   (2001-12-18 12:58) [4]

So what are the problems?
You need to add OnKeyPress and Key: = # 0;



Teacher   (2001-12-18 13:02) [5]

I process OnKeyUp, I do nothing except assigning #0 when getting the codes processed in OnKeyDown.



Виктор Щербаков   (2001-12-18 13:04) [6]

to Vladislav ©
From help:
Keys don’t correspond to an ASCII Char value (Shift or F1, for example) don’t generate an OnKeyPress event.



Владислав   (2001-12-18 13:06) [7]

> Victor Shcherbakov © (18.12.01 13: 04)

Yes, but they, thank God, and not "peep".



Виктор Щербаков   (2001-12-18 13:09) [8]

Try Ctrl + S for example :)



Владислав   (2001-12-18 13:19) [9]

> Victor Shcherbakov © (18.12.01 13: 09)

Not "beeping", however?

Anything else you think of?

:)))



voronkov   (2001-12-18 13:19) [10]

I tried to insert into OnKeyUp key: = 0, the problem remained. Well, elah-burns, what type to do?



Dmitriy(new)   (2001-12-18 14:29) [11]

TMyEdit = class (TEdit)
.
procedure KeyPress (var Key: Char); override;
.
End;

procedure TMyEdit.KeyPress (var Key: Char);
begin
case key of
#1..#12,#14..#26,#28..#255:;
else key: = # 0;
End;
End;


and do not "peep".



cdaDmitriy   (2001-12-18 15:22) [12]

work?



panov   (2001-12-18 15:26) [13]

Try this:
procedure TfDocEdit.FormKeyPress (Sender: TObject; var Key: Char);
begin
if (Key = #27) then
begin
Key: = # 0;
if (fDocEdit.ActiveControl is TEdit) then
begin
TEdit (fDocEdit .ActiveControl) .Text: = vPrevValue;
TEdit (fDocEdit.ActiveControl) .Modified: = False;
end;
end;
if (Key = #13) then
begin
Key: = # 0;
Perform (WM_NEXTDLGCTL, 0,0);
end;
end;



panov   (2001-12-18 15:27) [14]

And do not forget to set
TfDocEdit.KeyPreview: = True;



cdaDmitriy   (2001-12-18 15:32) [15]

>> panov ©
forgot KeyPreview: = true;
and the question is what will you do if on the form / project 10 ..n TEdit?

forgot oop



voronkov   (2001-12-18 16:06) [16]

Dude, thank you all. Do not peep combination with
case key of
#13: begin
.
end;
else key: = # 0;
End;
in OnKeyPress, though it’s a bit unusual to work with this event, as I’m used to working with VK type constants _...
Unfortunately, I am writing a program with a large amount of manual input and often different TEdit must respond differently to the same keys, otherwise you can use form events. So the PLO here does not save the father of Russian democracy.



panov   (2001-12-18 16:12) [17]

> cdaDmitriy © (18.12.01 15: 32)
Each prescribe the name of this handler.



cdaDmitriy   (2001-12-18 16:15) [18]

> panov © forgot OOP
make a new component (T..Edit) once

procedure KeyPress (var Key: Char); override;

and you use it



Pages: 1 whole branch

Forum: "Main";
Current archive: 2002.01.08;
Download: [xml.tar.bz2];

Top









Memory: 0.61 MB
Time: 0.031 c
1-22237
PVR
2001-12-16 17:20
2002.01.08
TListView help sort


14-22357
Viktor Shcherbakov
2001-11-01 12:40
2002.01.08
Photo recovery


1-22199
T2
2001-12-16 07:16
2002.01.08
Make process


1-22021
Socol
2001-12-18 08:54
2002.01.08
Download file!


6-22307
Leviathan
2001-10-12 12:54
2002.01.08
NMFTP sucks !!!!





afrikaans albanian Arabic armenian azerbaijani basque belarusian bulgarian catalan Chinese (Simplified) Chinese (Traditional) croatian Czech danish Dutch English estonian filipino finnish French
galician georgian German greek haitian Creole hebrew Hindi hungarian icelandic indonesian Irish italian Japanese Korean latvian lithuanian macedonian malay maltese norwegian
persian polish portuguese Romanian russian serbian slovak Slovenian Español swahili Swedish thai turkish Ukrainian urdu vietnamese welsh yiddish bengali bosnian
cebuano Esperanto gujarati hausa hmong igbo javanese kannada khmer lao latin maori marathi mongolian nepali punjabi somali tamil telugu yoruba
zulu
English French German Italian Portuguese Russian Spanish