Autor Beitrag
rami
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23

Win XP, Linux (K)ubuntu
Delphi 2005 Personal (, PHP, HTML, MySQL, ...)
BeitragVerfasst: So 09.03.08 21:12 
ich habe es jetzt endlich mit KeyDown geschafft in einem Edit die Entertaste abzufangen.
Nun gibt das einen hässlichen Sound. Google liefert nur www.delphipraxis.net/topic28126.html - was nicht funktioniert.
Könnt ihr mir helfen?


Moderiert von user profile iconGausi: Topic aus Sonstiges (Delphi) verschoben am So 09.03.2008 um 21:15
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: So 09.03.08 21:15 
Hi,

da haben die wohl einen Fehler gemacht, es muss "Key := #0" heißen!
Schreib das mal ins OnKeyPress Ereignis.

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
rami Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 23

Win XP, Linux (K)ubuntu
Delphi 2005 Personal (, PHP, HTML, MySQL, ...)
BeitragVerfasst: Mo 10.03.08 12:48 
leider nicht.

Der Delphi 2005-Compiler hat folgendes geschrieben:
[Fehler] _client.pas(219): E2010 Inkompatible Typen: 'Word' und 'Char'

219:
ausblenden Delphi-Quelltext
1:
        Key := #0;					
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mo 10.03.08 14:55 
schon mal mit 'Key:=Chr(#0)' probiert??

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Mo 10.03.08 15:00 
Hallo,

ich weiß zwar nicht, wie man das direkt in diesem Ereignis machen könnte, aber du kannst folgendes probieren:

Erstelle einen Button, setze die Breite auf 0 (Visible muss True bleiben!), und setze die Eigenschaft Default beim OnEnter des Edits auf True, und beim OnExit wieder auf False. Dann brauchst du gar kein OnKeyDown; du kannst es aber trotzdem verwenden. Da dann ein Standard-Button definiert ist, kommt auch kein Ding mehr.

Grüße,
Yogu
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8554
Erhaltene Danke: 481

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Mo 10.03.08 15:03 
Normalerweise funktioniert das mit dem Nullsetzen des Keys. Zeig doch mal deinen Code (etwas mehr als eine Zeile). Das mit Word und Char hängt damit zusammen, ob man das OnKeyDown oder OnKeyPress-Event nimmt. Bei dem einen kommts als Char, bei dem anderen als Word an...

Frage: Wie genau äußert sich denn "funktioniert nicht"?

@Yogu: Das meinst du hoffentlich nicht ernst, oder? Das ist ja fast schlimmer als ein unsichtbares Memo zur Speicherung einer Stringlist oder so zu verwenden...:roll:

_________________
We are, we were and will not be.
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mo 10.03.08 15:07 
user profile iconGausi hat folgendes geschrieben:
@Yogu: Das meinst du hoffentlich nicht ernst, oder? Das ist ja fast schlimmer als ein unsichtbares Memo zur Speicherung einer Stringlist oder so zu verwenden...:roll:


soll man das etwa nicht??? :shock:






sry for Spam! :mrgreen:

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Mo 10.03.08 15:14 
user profile iconGausi hat folgendes geschrieben:
@Yogu: Das meinst du hoffentlich nicht ernst, oder? Das ist ja fast schlimmer als ein unsichtbares Memo zur Speicherung einer Stringlist oder so zu verwenden...:roll:

Doch ich mene es ernst. Ich weiß, dass das gebastelt ist, aber bis jetzt hatte ich noch keine aktieptable Lösung gefunden. :mrgreen:

Mit OnKeyDown will das bei mir tatsächlich nicht beim Nullsetzen, aber jetzt habe ich gesehen, dass es bei OnKeyPress geht, wenn ich Key auf #0 setze.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Mo 10.03.08 18:01 
user profile iconHidden hat folgendes geschrieben:

da haben die wohl einen Fehler gemacht

user profile iconYogu hat folgendes geschrieben:

Mit OnKeyDown will das bei mir tatsächlich nicht beim Nullsetzen, aber jetzt habe ich gesehen, dass es bei OnKeyPress geht

user profile iconHidden hat folgendes geschrieben:

Schreib das mal ins OnKeyPress Ereignis.

user profile iconYogu hat folgendes geschrieben:

wenn ich Key auf #0 setze.

user profile iconHidden hat folgendes geschrieben:

es muss "Key := #0" heißen!


Tolles Diskussionsergebnis :lol:

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)
Yogu
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2598
Erhaltene Danke: 156

Ubuntu 13.04, Win 7
C# (VS 2013)
BeitragVerfasst: Mo 10.03.08 18:30 
Sorry für OT, user profile iconHidden. Aber ich muss mich doch irgendwie verteidigen :wink:

user profile iconrami hat sich bis jetzt nicht mehr gemeldet, aber es stimmt schon, du hast die Frage eigentlich schon vollständig beantwortet. Sorry. :oops:
elundril
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 3747
Erhaltene Danke: 123

Windows Vista, Ubuntu
Delphi 7 PE "Codename: Aurora", Eclipse Ganymede
BeitragVerfasst: Mo 10.03.08 18:34 
funzts mit meiner methode nicht auch bei dem ereignis das der Theardsteller haben will?

lg elundril

_________________
This Signature-Space is intentionally left blank.
Bei Beschwerden, bitte den Beschwerdebutton (gekennzeichnet mit PN) verwenden.
Hidden
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2242
Erhaltene Danke: 55

Win10
VS Code, Delphi 2010 Prof.
BeitragVerfasst: Mo 10.03.08 18:38 
@ user profile iconYugo:
Ich meinte nur den Umweg über den Button.
user profile iconelundril hat folgendes geschrieben:

funzts mit meiner methode nicht auch bei dem ereignis das der Theardsteller haben will?

Hmm... ich dachte es besteht ein Unterschied zwischen OnKeyDown und OnKeyPress, in Bezug auf den Zeitpunkt... Ich dachte das eine wäre vor dem Verarbeiten(da könnte mans abfangen) und das eine danach. Scheint wohl nicht so zu sein.

mfG,

_________________
Centaur spears can block many spells, but no one tries to block if they see that the spell is a certain shade of green. For this purpose it is useful to know some green stunning hexes. (HPMoR)