Autor Beitrag
Niko S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: Mo 18.12.06 20:32 
ausblenden Delphi-Quelltext
1:
  if (Key = '"'then begin Key:=#0; PostKeyEx32(Ord('2'), [ssShift], False); PostKeyEx32(VK_LWIN, [], False); end;					


Ich benutze das hier: www.swissdelphicente.../showcode.php?id=220
Um einen tastendruck zu simulieren .
Ich möchte das bei einem druck auf " (also shift+2) nochmals die taste gedrückt wird bzw das symbol " doppelt erscheint und dann der cursor wieder zurück in die "" springt .
Allerdings beim drücken der shift+2 kombinantion tut er so als würde er die Windows taste drücken <_< und nichts passiert emhr
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mo 18.12.06 20:42 
Ich zitiere von dem Artikel:
Swiss Delphi Center hat folgendes geschrieben:
//Pressing the Left Windows Key
PostKeyEx32(VK_LWIN, [], False);

Du drückst damit nicht die Pfeiltaste, sondern die Windows-Taste.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Niko S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: Mo 18.12.06 20:50 
stimmt ^^
gut anderes problem ist nun, dass er weder ein " macht noch die taste VK_LEFT loslässt!
hab enifach VK_LWIN durch VK_LEFT ersetzt
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mo 18.12.06 21:03 
Dass er gar nichts anzeigt, liegt am Key := #0;.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Niko S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: Mo 18.12.06 21:05 
joah weggenommen aber trozdem zeigt der nur einmal "
ich möchte aber dassa da wiederholt damit da "" ist ...
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Mo 18.12.06 21:13 
Jo, ich weiß ;-).

Das hier geht schon "ganz" gut:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
  if Key = '"' then
  begin
    keybd_event(VK_SHIFT, MapVirtualKey(VK_SHIFT, 0), 00);
    keybd_event(Ord('2'), MapVirtualKey(Ord('2'), 0), 00);
    keybd_event(Ord('2'), MapVirtualKey(Ord('2'), 0), KEYEVENTF_KEYUP, 0);
    keybd_event(VK_SHIFT, MapVirtualKey(VK_SHIFT, 0), KEYEVENTF_KEYUP, 0)
  end;

Aber, es wird ja jedes mal wieder onKeyPress aufgerufen und damit das keybd_event. Das könntest du mit einer Variable vom Typ Boolean verhindern.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Niko S. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 566
Erhaltene Danke: 10

Win 7, Ubuntu
Lazarus, Turbo Delphi, Delphu 7 PE
BeitragVerfasst: Mo 18.12.06 22:04 
Funzt fein danke.