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.

Newcomers DBPro Corner / Mouse commands don't work when Darkbasic Pro window is inactive

Author
Message
Brally
10
Years of Service
User Offline
Joined: 3rd Nov 2014
Location:
Posted: 29th Oct 2015 16:20
I know I said before that I consider myself an expert when it comes to the mouse commands, but whenever I try to use them after clicking outside my program window, they don't work anymore!
Is there a way I can use the mouse commands while my program window is not the active window?

What I plan to do is use the mouse commands to click on the on-screen keyboard that comes with windows and make it type for me, then use them to click around the screen and interact with stuff.
I speak English, I don\'t speak DarkBASIC!
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 29th Oct 2015 18:44
Why not use the keyboard functions to interact with the virtual keyboard?
Brally
10
Years of Service
User Offline
Joined: 3rd Nov 2014
Location:
Posted: 29th Oct 2015 19:04
What keyboard functions? I've only used the mouse for everything I've tried so far.

I'm still very inexperienced with Darkbasic Pro, I still need to find out why the mouse commands stop working when the program window becomes inactive.

The mouse commands I use are these ones



I downloaded Matrix1Utils yesterday, is there anything in there that I could use?
I speak English, I don\'t speak DarkBASIC!
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 30th Oct 2015 06:57 Edited at: 30th Oct 2015 07:52
When a window is not active it has no focus to input devices. You wouldn’t want your application responding to keyboard input while notepad is active.

Activate the virtual keyboard and run this snippet. If I understand, this is what you’re wanting.

Brally
10
Years of Service
User Offline
Joined: 3rd Nov 2014
Location:
Posted: 30th Oct 2015 16:28
That code made no sense to me at all!

From what I saw though, the program doesn't type outside the Darkbasic Pro window and I need it to.

As soon as I do anything outside the Darkbasic Pro window, my program no longer carries out any commands.

Why would Darkbasic Pro stop carrying out commands when the window is inactive? Other programs like Windows Media Player for example don't do that.

Play an MP3 in Windows Media Player and put it behind another window, the MP3 still plays. Make a Darkbasic Pro program and put it behind another window, it stops working!

Clearly Darkbasic Pro isn't capable of doing what I need it to do, I'll have to look for an alternative solution elsewhere.
I speak English, I don\'t speak DarkBASIC!
WickedX
15
Years of Service
User Offline
Joined: 8th Feb 2009
Location: A Mile High
Posted: 30th Oct 2015 19:43
Ok, I understand now. I have the un-active app moving the mouse on the virtual keyboard. I am just not getting the mouse click. MSDN states mouse_event has been superseded. Use SendInput instead.
Brally
10
Years of Service
User Offline
Joined: 3rd Nov 2014
Location:
Posted: 30th Oct 2015 22:00
I've been looking all over the place for alternate solutions and I think I've found one.
This macro program not only does everything I wanted my Darkbasic Pro program to do, it also has a few other little features that Darkbasic Pro can't do (as far as I know) which I'm sure I'll find useful.
http://www.murgee.com/auto-mouse-click/

I read just now on this other thread that SendInput doesn't work any better than Mouse_Click does!
https://forum.thegamecreators.com/thread/188439

Well, at least I have a macro program I can play with for a while.
I speak English, I don\'t speak DarkBASIC!

Login to post a reply

Server time is: 2024-11-21 13:10:45
Your offset time is: 2024-11-21 13:10:45