Autor Beitrag
Green
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

Windows XP Home
Delphi 6 Enterprise
BeitragVerfasst: Sa 17.06.06 13:00 
hat jemand ne tabelle wo alle tasten mit dem dazugehörigen #xx wert stehen?
also sowas wie enter = #13 etc...


Moderiert von user profile iconChristian S.: Topic aus Off Topic verschoben am Sa 17.06.2006 um 20:06
Leuchtturm
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1087

Win Vista, Knoppix, Ubuntu
Delphi 7 Pe, Turbo Delphi, C#(VS 2005 Express), (X)HTML + CSS, bald Assembler
BeitragVerfasst: Sa 17.06.06 13:26 
Ich versteh nicht ganz was du meinst

_________________
Ich bin dafür verantwortlich was ich sage - nicht dafür was du verstehst.
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Sa 17.06.06 13:28 
user profile iconGreen hat folgendes geschrieben:
hat jemand ne tabelle wo alle tasten mit dem dazugehörigen #xx wert stehen?
Sowas existiert nur für Zeichen, nicht für Tasten und nennt sich ASCII Table. Für moderne Zeichen wie das Euro-Zeichen brauchst du eine entsprechende Tabelle für das von dir ausgewählte ANSI-Locale. Für WindowsXP wird das die Codepage 1252 sein, zu finden hier (die Tabellen dort sind ein wenig blöd zu lesen, weil sie auf andere Tabellen verweisen, aber die kann man sich ja abschreiben und die hexadezimalen Zahlen in dezimale umrechnen).

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
r2c2
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 324
Erhaltene Danke: 2

Linux

BeitragVerfasst: Sa 17.06.06 13:38 
www.dsdt.info/grundlagen/codes/

Das solte das sein, was du suchst...

//Nachtrag:
10 min zu langsam! :shock:

mfg

Christian

_________________
Kaum macht man's richtig, schon klappts!
Green Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

Windows XP Home
Delphi 6 Enterprise
BeitragVerfasst: Sa 17.06.06 14:07 
also habs mal mit folgender site probiert.

und zwar mit folgendem code aber es will nit...

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if shift = [ssCtrl] then
    if key = VK_A then
      showmessage('Ctrl + A');
end;
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Sa 17.06.06 14:53 
wie wärs mit Ord und Chr?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TForm1.Edit1KeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
 if shift = [ssCtrl] then
    if key = Ord('A') then
      showmessage('Ctrl + A');
end;
:P
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: Sa 17.06.06 16:43 
Hol doch mit GetKeyState den Status der Taste (if GetKeyState(...)<0 Then)
und das mit zwei Ifs (also eine für Strg und eine für a) und dass in nen Timer(Intervall so um 50).
MfG Fighter#1

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Sa 17.06.06 16:56 
user profile iconFighter#1 hat folgendes geschrieben:
Hol doch mit GetKeyState den Status der Taste [...] und dass in nen Timer(Intervall so um 50).
Richtig, bei heutigen Prozessoren haben wir eh genug Rechenzeit und die will auch niemand anders haben, also können wir uns ruhig die gesamte Prozessorleistung unter den Nagel reißen.
Mal ehrlich, es gibt Events, die Anwendung wird darüber benachrichtigt, wenn irgendwas interessantes passiert (und vor allem: wenn es deiner Anwendung passiert, der User also mit dir etwas zu tun haben will, und nicht mit einer anderen Anwendung, die parallel läuft), diese Events sollte man auch nutzen.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
Fighter#1
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 787

Win XP, Ubuntu 8.04
Turbo Delphi 2006, Delphi 2005 Pe, Delphi 5 Pe, Netbeans 6.1, Eclipse, Microsoft VisualC#, Dev C++, PHP, HTML, CSS
BeitragVerfasst: So 18.06.06 09:30 
:-)
Stimmt schon, aber die on KeyDown procedure ist imho für meine Zwecke meist unbrauchbar.

_________________
Wer andere beherrscht ist stark,
wer sich selbst beherrscht ist mächtig. Lao Tse
fidionael
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 232

Win XP SP2, Ubuntu 6.06
Delphi 7 PE, Delphi 3 Prof
BeitragVerfasst: So 18.06.06 10:21 
Also außer bei Spieleporgrammierung bin ich mit der OnKeyDown-Prozedur bisher immer gut gefahren. Und in der Spieleprogrammierung hat man sowieso (für gewöhnlich) einen Timer der regelmäßig ausschlägt, so dass man da die GetAsyncKeyState-Variante tatsächlich anwenden kann.

Aber sonst - wofür reicht die OnKeyDown-Prozedur denn nicht? Notfalls fang halt das KeyDown-Event von Windows direkt ab, aber ich wüsste so spontan wirklich nicht wofür.
Green Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

Windows XP Home
Delphi 6 Enterprise
BeitragVerfasst: So 18.06.06 11:30 
das problem mit Ord('') is jetz halt das ich ja auch sachen wie Enter und F1 - F12 tasten und ende, einfg etc. abfragen will... und dazu sind ja diese VK_ konstanten da, welche aber bei mir nit funzen, was mir vllt. jemand erklären könnte ^^
r2c2
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 324
Erhaltene Danke: 2

Linux

BeitragVerfasst: So 18.06.06 14:41 
user profile iconGreen hat folgendes geschrieben:
das problem mit Ord('') is jetz halt das ich ja auch sachen wie Enter und F1 - F12 tasten und ende, einfg etc. abfragen will... und dazu sind ja diese VK_ konstanten da, welche aber bei mir nit funzen, was mir vllt. jemand erklären könnte ^^

Hast du das mit Ord schon mal ausprobiert? Dann hättest du gemerkt, dass da n Fehler drin ist...

Also jetzt mal zum besseren Verständnis:
Es gibt 2(bzw. 3) Events mit denen man sowas bewerkstelligen kann:
- OnKeyDown: benötigt den Virtuellen Tastencode
- OnKeyPress benötigt das Zeichen als Char

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
procedure TForm1.FormKeyDown(Sender: TObject; var Key: Word;
  Shift: TShiftState);
begin
  if Key = VK_RETURN then // der virtuelle Tastencode für die Return-Taste
    Beep;
end;

procedure TForm1.FormKeyPress(Sender: TObject; var Key: Char);
begin
  if Key = #13 then // das Zeichen CarriadeReturn
    Beep;
end;


Im ersten Fall fragst du Tasten ab, im zweiten Zeichen...

mfg

Christian

_________________
Kaum macht man's richtig, schon klappts!
Green Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 283

Windows XP Home
Delphi 6 Enterprise
BeitragVerfasst: So 18.06.06 17:42 
aaaaaaaah ok jetzt hab ichs kapiert, aber das mit ord() hat bei mir geklappt... -.-
r2c2
ontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic starofftopic star
Beiträge: 324
Erhaltene Danke: 2

Linux

BeitragVerfasst: So 18.06.06 18:02 
user profile iconGreen hat folgendes geschrieben:
aaaaaaaah ok jetzt hab ichs kapiert, aber das mit ord() hat bei mir geklappt... -.-

*nochmal schnell in die Hilfe guckt*
Ähm... ok ich nehm alles zurück und behaupte das Gegenteil :wink:
War kein Fehler. VK_A = Ord('A'). Bei Buchstaben stimmt das. Jetzt hab ich auch noch was gelernt. Hab bis jetzt immer nur VK_RETURN benutzt... :oops:

mfg

Christian

_________________
Kaum macht man's richtig, schon klappts!