Keyboard Simulation - Low-level / Pascal / Delphi / Keyboard input simulation

free web hosting
Free Web Hosting > Computers & Tech > Programming > Programming General > Delphi & (Object) Pascal

Keyboard Simulation - Low-level / Pascal / Delphi / Keyboard input simulation

KDEWolf
I'm trying to simulate a key press in an external program (actually a game).
Using the keybd_event does work for regular Windows programs (like Notepad, for example), but not for the game. I suppose this happens because it uses DirectX libraries, and also this simulation provided by keybd_event isn't, let's say, low-level enough. Would someone be able to help me on this?
I'm using currently Delphi (Pascal), but if needed I suppose I can manage to apply some assembly code or something. Thanks in advance.

Reply

Chesso
Looks like I missed this one....

I have done this for Age Of Empires 2, to automatically enter cheats very fast to get resources up alot quicker (for my younger brother) in Delphi 7.

Not sure why you are having problems with keybd_event, but don't forget about SendMessage and PostMessage API's.

Which is most likely how I managed to get it done. Unfortunately the old Age Of Empires 2 project is long gone with an old crash of my older pc which I lost alot of good old Delphi projects (should have backed em up eh).

Reply

yordan
huh ? did you really post here in order to explain that you had the solution of the problem and you don't have it any more so no more need for posting an answer ? biggrin.gif

Reply

Chesso
Not at all, I provided two alternatives to sending key presses which are the SendMessage and PostMessage API's.

They are both fairly much the same except that SendMessage will wait until it's done where as PostMessage will just send it and come back not worrying about whether it got to it's location or not.

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Recent Queries:-
  1. delphi 7 code if keypress = ctrl - 10.63 hr back. (1)
  2. windows keyboard input simulate - 22.10 hr back. (1)
  3. delphi keypress simulated - 37.73 hr back. (1)
  4. key press simulator windows - 43.70 hr back. (1)
  5. delphi postmessage api - 43.78 hr back. (1)
  6. keyboard low level windows xo - 45.41 hr back. (1)
  7. delphi simulate keypress - 46.99 hr back. (1)
  8. delphi onscreen keyboard component - 50.09 hr back. (1)
  9. pascal keypress simulation - 51.33 hr back. (1)
  10. delphi key press no space - 56.02 hr back. (1)
  11. keyboard simulation - 4.90 hr back. (4)
  12. how to send keyboard events delphi - 63.01 hr back. (1)
  13. delphi sendmessage key press - 71.28 hr back. (1)
  14. delphi how to wait keypress - 72.37 hr back. (1)
Similar Topics

Keywords : keyboard, simulation, low, level, pascal, delphi, keyboard, input, simulation

  1. Hide Delphi's Splash Screen - Delphi 6
    (0)
  2. Delphi 6 And XP
    (2)
    My old Delphi 4 will not run on an XP system. Does Delphi 6 run in an XP environment and/or will an
    application developed in Delphi 6 run in an XP environment?....
  3. Can Delphi Be Used For Distributed Appz?
    (1)
    I am about to start a project that will require me to write a client program which will access a
    database (mysql) across the internet. Will Delphi 2006 Professional have the tools I need to do
    this, or will I need to get Enterprise or Architect. Note that we are not planning on using model
    driven architecture in this project, so buying Enterprise or Architect for Bold or ECO isn't
    required. Thanks wojta....
  4. Help: Change Language On Fly With Delphi
    delphi 5-8 (3)
    Hi guys, what is the best option for delphi if I want to change languages on fly in my applications?
    thx Wojta....
  5. Where Can I Find Free Skin Component For Delphi
    (1)
    Somebody knows some component delphi that I allow to use skin in my application? If possible that he
    is free.....
  6. Uploading File Using Delphi To A Php Upload Script
    delphi 6 would be prefered (4)
    simple question: how to upload files using delphi, using http protokol that will be received by php
    script ? ex: delphi ---------------> www.giveittome.com/whereisit.php thanks Oncom Beureum....
  7. Resources For Beginner Delphi Programmer ?
    Delphi 7.0 Personal (11)
    Hi, I've just purcased Borland Delphi 7.0 Personal, as I've have an idea to an publication
    that I wish to create. But I seemed much more complicated than I was expected. I've been
    working with webdesigning for several years, and also PHP programming, but never worked with any
    core programming applications like this. My question is as follow. Do anyone have any expirence
    about Delphi, and do any knows where to find turtorials or even better samples, as I really like to
    try this out and then further as it looks funny and cool. My application idea is somethi....
  8. List Of Delphi Keyboard Shortcut - Very Useful
    (2)
    Code Insight Code Parameters : Ctrl-Shift-Space Code Completion : Ctrl-Space Code
    Templates : Ctrl-J Class Completion Class Completion : Ctrl-Shift-C Class Nav
    Up Ctrl-Shift-Up Class Nav Down Ctrl-Shift-Down Code Browsing (D6 and above) Symbol Browsing :
    Alt-Up Browse Forward : Alt-Right Browse Backward : Alt-Left Message Window Previous
    Message : Alt-F7 Next Message : Alt-F8 IDE Windows Code Explorer : Ctrl-Shift-E Project
    Manager : Ctrl-Alt-F11 Window List : Alt-0 (zero) Object Inspector : F11 Debugger Windows
    Event Log :....

    1. Looking for keyboard, simulation, low, level, pascal, delphi, keyboard, input, simulation

Searching Video's for keyboard, simulation, low, level, pascal, delphi, keyboard, input, simulation
advertisement




Keyboard Simulation - Low-level / Pascal / Delphi / Keyboard input simulation



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE