Autor Beitrag
pHaRyNx
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 94

win 95, win 2000, win xp, VISTA, Ubuntu 8.04
Delphi 7 PE
BeitragVerfasst: Sa 21.01.06 16:52 
hi!
im rahmen eines spieletrainers möchte ich, dass beispielsweise die enter-taste von meinem trainer (sozusagen) gedrückt wird (also ich bin im spiel und im hintergrund läuft mein trainer. dann so beispielsweise über timerereignis automatisch die konsole mit enter aufgerufen werden). Wie kann man das realisieren?
mfg pHaRyNx


Moderiert von user profile iconChristian S.: Topic aus Sonstiges (Delphi) verschoben am Sa 21.01.2006 um 16:53
WolfB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 39

WinXP Professional
Delphi 7
BeitragVerfasst: Sa 21.01.06 19:47 
ausblenden Quelltext
1:
  keybd_event(vk_return,0,0,0);					

der befehl simuliert die enter taste.
pHaRyNx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 94

win 95, win 2000, win xp, VISTA, Ubuntu 8.04
Delphi 7 PE
BeitragVerfasst: So 22.01.06 16:41 
cool 8), die keybd_event-Befehle sind ja 1a. danke.
noch eine frage:
mit z.B. " keybd_event(vk_CAPITAL,0,0,0);" lässt sichder capslock aktivieren, kann man ihn auch mit einem ähnlichen befehl deaktivieren?
WolfB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 39

WinXP Professional
Delphi 7
BeitragVerfasst: Di 24.01.06 21:25 
sorry, keine ahnung. das hat mir gerade selbst schon kopfschmerzen bereitet :S das geht ja garnet den zu deaktivieren !!
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Mi 25.01.06 11:40 
Kunststück, du drückst die Taste ja immer noch...
ausblenden Delphi-Quelltext
1:
2:
3:
      keybd_event(VK_CAPITAL, 0, 0, 0);
      // Taste wieder loslassen
      keybd_event(VK_CAPITAL, 0, KEYEVENTF_KEYUP, 0);


Das Ganze in ein ButtonClick-Event, dann kannst du mit dem Button CapsLock ein- und ausschalten.

Gruß,
raziel

_________________
JSXGraph
pHaRyNx Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 94

win 95, win 2000, win xp, VISTA, Ubuntu 8.04
Delphi 7 PE
BeitragVerfasst: So 05.02.06 10:43 
wie gesagt, klappt, bis auf das Hochkomma '
gibt es da noch irgendeine möglichkeit für?