Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
MummyKillerSLO
17
Years of Service
User Offline
Joined: 5th Jul 2009
Location: Object Position Y(ObjChair)
Posted: 21st Aug 2011 21:29
Hello! I want to force 'R' key when mouse is clicked. Can it be done with DLL (maybe User32.dll)?

Happy to having and using DarkBASIC Professional...
revenant chaos
DBPro Master
19
Years of Service
User Offline
Joined: 21st Mar 2007
Location: Robbinsdale, MN
Posted: 21st Aug 2011 22:53
Quote: "I want to force 'R' key when mouse is clicked. Can it be done with DLL (maybe User32.dll)?"
Yep, look here: http://forum.thegamecreators.com/?m=forum_view&t=183312&b=7
MummyKillerSLO
17
Years of Service
User Offline
Joined: 5th Jul 2009
Location: Object Position Y(ObjChair)
Posted: 22nd Aug 2011 13:30
Thanks, is there any way to lets say simulate 'R' key into games (like DirectInput or Sendinput()?)

Happy to having and using DarkBASIC Professional...
IanM
Retired Moderator
23
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 22nd Aug 2011 16:40
How do you think this will work?

In your original post, you want to trigger a keypress when the mouse button is clicked - DBPro will only detect the mouse button if it's the program with focus, and because it has focus, any key event you create will automatically be passed to your DBPro window.

Now you say that you want to affect another program. Either that program will have focus, stopping DBPro from getting mouse clicks, or your DBPro program will have focus, stopping your game from getting your simulated keyboard clicks.

Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 23rd Aug 2011 04:36
@ MummyKillerSLO:

Maybe if you tell us exactly what you're trying to do on more than a single line we can help you.

MummyKillerSLO
17
Years of Service
User Offline
Joined: 5th Jul 2009
Location: Object Position Y(ObjChair)
Posted: 23rd Aug 2011 11:47
Well in my first post I said to simulate 'R' key when mouse is pressed as example. I want to somehow simulate 'R' key to work in other games (like NFS). Lets say if we press key 'C', the DBPro program will simulate key 'R' like it was pressed on keyboard physically (not VirtualKey, because games read keys direct from keyboard and not work with VirtualKeys).

I'm not so good at english so it's hard to explain .

Happy to having and using DarkBASIC Professional...
Grog Grueslayer
Valued Member
21
Years of Service
User Offline
Joined: 30th May 2005
Playing: Green Hell
Posted: 23rd Aug 2011 18:25 Edited at: 23rd Aug 2011 18:26
Like IanM said Darkbasic Pro is not going to work for you that way. The only way to really do what you want is to download a macro program. I use a macro program for my data entry job called My Macros that works real well for annoying repetitive things. You can make macros to insert keystrokes, trigger mouse events like moving the mouse automatically and clicking buttons, delays, run other macros, launch programs, load web pages, manipulate windows, dial a phone number, and even shut down your computer. You can download a trial version or buy it for only $30USD. It may look primitive but it's well worth the money.

http://www.drivermagician.com/AutomationSoftware/index.htm

Login to post a reply

Server time is: 2026-07-10 20:58:10
Your offset time is: 2026-07-10 20:58:10