Jump to content


Photo

Dll : Mouse Controller


  • Please log in to reply
37 replies to this topic

#1 CyberTwister

CyberTwister

    GMC Member

  • GMC Member
  • 246 posts

Posted 28 March 2007 - 10:41 PM

Hi :)
I think i have seen a dll like this before, but i don't remember where...
However, this is a new one.

You can simulate 1 or more clic (right or left).
You can get/set mouse position.

Zip contain a gm6 and the dll.
DOWNLOAD

Sure, this dll isn't very usefull...
But maybe someone will need it :D

Edited by CyberTwister, 28 March 2007 - 11:29 PM.

  • 1

#2 gm man

gm man

    GMC Member

  • New Member
  • 98 posts
  • Version:Unknown

Posted 30 March 2007 - 09:15 AM

Thank you very, very, much. I was looking for something like this so I can create a program that draws normal images onto white board things on websites... mainly the ones on Bebo.

Don't ask me why I want to make that, I don't know myself.
  • 0

#3 the_doominator

the_doominator

    Eight Star

  • New Member
  • 925 posts

Posted 17 April 2007 - 09:47 PM

why would u need this. Game maker can already set x and y. and you can use user defined instead of simulating a mouse click.

5/10. Works perfectly but strikes me as useless.
  • 0

#4 gmguy249

gmguy249

    GMC Member

  • New Member
  • 118 posts

Posted 18 April 2007 - 06:22 PM

Actually GameMaker can't set x&y for the mouse it just reads them. Personally i've been looking for a dll like this in order to simulate the mouse through a joystick
  • 0

#5 the_doominator

the_doominator

    Eight Star

  • New Member
  • 925 posts

Posted 18 April 2007 - 08:58 PM

Actually GameMaker can't set x&y for the mouse it just reads them. Personally i've been looking for a dll like this in order to simulate the mouse through a joystick

<{POST_SNAPBACK}>


This is the page from the help file entitled The Window under graphics under GML.
The actual game happens in a window. This window has a number of properties, like whether it has a border, whether it is full screen, etc. Normally these are set in the Game Settings. But you can change then during the game. The following functions exist for this: 

window_set_visible(visible) Sets whether the game window is visible. Clearly you normally want the window to remain visible during the whole game. The program will not receive keyboard events when the window is invisible.
window_get_visible() Returns whether the game window is visible.
window_set_fullscreen(full) Sets whether the window is shown in full screen mode.
window_get_fullscreen() Returns whether the window is shown in full screen mode.
window_set_showborder(show) Sets whether the border around the window is shown. (In full screen mode it is never shown.)
window_get_showborder() Returns whether the border around the window is shown in windowed mode.
window_set_showicons(show) Sets whether the border icons (iconize, maximize, close) are shown. (In full screen mode these are never shown.)
window_get_showicons() Returns whether the border icons are shown in windowed mode.
window_set_stayontop(stay) Sets whether the window must always stay on top of other windows.
window_get_stayontop() Returns whether the window always stays on top of other windows.
window_set_sizeable(sizeable) Sets whether the window is sizeable by the player. (The player can only size it when the border is shown and the window is not in full screen mode.)
window_get_sizeable() Returns whether the window is sizeable by the player.
window_set_caption(caption) Sets the caption string for the window. Normally you specify this when defining the room and it can be changed using the variable room_caption. So this function is normally not useful, unless you draw the room yourself rather than letting Game Maker do it. The caption is only visible when the window has a border and when it is not in full screen mode.
window_get_caption() Returns the window caption.
window_set_cursor(curs) Sets the mouse cursor used in the window. You can use the following constant: 

cr_default
cr_none
cr_arrow
cr_cross
cr_beam
cr_size_nesw
cr_size_ns
cr_size_nwse
cr_size_we
cr_uparrow
cr_hourglass
cr_drag
cr_nodrop
cr_hsplit
cr_vsplit
cr_multidrag
cr_sqlwait
cr_no
cr_appstart
cr_help
cr_handpoint
cr_size_all

In particular, to hide the mouse cursor, use cr_none as value.
window_get_cursor() Returns the cursor used in the window.
window_set_color(color) Sets the color of the part of the window that is not used for displaying the room.
window_get_color() Returns the window color.
window_set_region_scale(scale,adaptwindow) If the window is larger than the actual room normally the room is displayed in a region centered in the window. It is though possible to indicate that it must be scaled to fill the whole or part of the window. A value of 1 is no scaling. If you use a value of 0 the region will be scaled to fill the whole window. If you set it to a negative value it will be scaled to the maximal size inside the window while maintaining the aspect ratio (this is often what you want). adaptwindow indicates whether the window size must be adapted if the scaled room does not fit in. Adapting the window is only effective when the scale factor is positive.
window_get_region_scale() Returns the scale factor for the drawing region.


The window has a position on the screen and a size. (When we talk about position and size we always mean the client part of the window without the borders.) You can change these although you hardly ever do from within your game. Normally they are determined automatically or by the player. The following functions can be used to change the window position and size. Note that these functions deal with the windowed mode. If the window is in full screen mode they can still be used but will only have effect when switching full screen mode off. 


window_set_position(x,y) Sets the position of the (client part of the) window to the indicated position.
window_set_size(w,h) Sets the size of the (client part of the) window to the indicated size. Note that is the indicated size is too small to fit the drawing region it is kept large enough for the region to fit it.
window_set_rectangle(x,y,w,h) Sets the position and size of the window rectangle. (Does both previous routines in one step.)
window_center() Centers the window on the screen.
window_default() Gives the window the default size and position (centered) on the screen.
window_get_x() Returns the current x-coordinate of the window.
window_get_y() Returns the current y-coordinate of the window.
window_get_width() Returns the current width of the window.
window_get_height() Returns the current height of the window.

Again, you probably never want to use any of the window positioning functions as Game Maker takes care of these automatically. 

In rare cases you might want to know the position of the mouse with respect to the window. (Normally you always use the mouse position with respect to the room or with respect to a view.) The following functions exist for this. 


window_mouse_get_x() Returns the x-coordinate of the mouse in the window.
window_mouse_get_y() Returns the y-coordinate of the mouse in the window.
window_mouse_set(x,y) Sets the position of the mouse in the window to the indicated values.

If you read the bottom you will find that GM CAN set the mouse. In yo face!!!!
  • 0

#6 Dragonos

Dragonos

    Multimedia Pro

  • New Member
  • 357 posts

Posted 20 April 2007 - 01:39 PM

But only in the game window.
window_mouse_set(x,y) Sets the position of the mouse in the window to the indicated values.
Think Before you post.*cough the last three post*
In your face.
<Note This is not intended to start a flame war just to prove you wrong.>
*Evil laugh*
  • 0

#7 the_doominator

the_doominator

    Eight Star

  • New Member
  • 925 posts

Posted 21 April 2007 - 12:01 AM

when (within gamemaker) are you going to set the mouse to anywhere other than the window though?


*Laughs over inconspicious loophole*
  • 0

#8 Kantatzu

Kantatzu

    The Man In A Sugar Coma

  • New Member
  • 287 posts

Posted 21 April 2007 - 12:09 AM

Hang on...Can't you just set negative numbers and larger-than-room-specs integers for Window_mouse_set(x,y) so it goes outside window?

*Chuckles over my abhorrently phrased and stupid question*
  • 0
I'll endure the night/For the promise of light

#9 the_doominator

the_doominator

    Eight Star

  • New Member
  • 925 posts

Posted 21 April 2007 - 12:36 AM

he is right....

*grins behind obviously smarter GM member*
  • 0

#10 sleija

sleija

    GMC Member

  • New Member
  • 174 posts

Posted 22 April 2007 - 10:05 PM

you can use the GML functions, but a dll is faster. One example of that is the clipcursor DLL. You can do that in GML, but it looks really sloppy
  • 0

#11 tigmon

tigmon

    GMC Member

  • New Member
  • 16 posts

Posted 25 April 2007 - 08:53 PM

Hi ;)
I think i have seen a dll like this before, but i don't remember where...
However, this is a new one.

You can simulate 1 or more clic (right or left).
You can get/set mouse position.

Zip contain a gm6 and the dll.
DOWNLOAD

Sure, this dll isn't very usefull...
But maybe someone will need it  :P

<{POST_SNAPBACK}>


Travis-
I Think It Will be very usefull! Im trying to make a mouse recording program that will record all mouse actions and hopefully keyboard keys and play back all recorded input.
  • 0

#12 austin

austin

    GMC Member

  • New Member
  • 24 posts

Posted 21 May 2007 - 12:37 AM

I have been looking for a dll like this for forever! The only problem is that when
I start the example a screen pops up and says:

'Unexpected error occured while running the game.'

Can anyone help? ;)
  • 0

#13 chainsawkitten

chainsawkitten

    GMC Member

  • GMC Member
  • 1409 posts
  • Version:GM:Studio

Posted 23 May 2007 - 06:44 AM

Have you unzipped it first?
  • 0

#14 Tahnok

Tahnok

    Friendly Madman

  • GMC Member
  • 1854 posts
  • Version:GM:Studio

Posted 23 May 2007 - 08:47 AM

No need for negative numbers. You forget about:

display_mouse_set(x,y) Sets the position of the mouse on the display to the indicated values.

Exactly what's needed if you're going to be doing work outside the window.

Anyway, what can this DLL do that SleeK GeeK's Mouse Solutions DLL can't?
  • 0

gmc_signature.png


#15 xDanielx

xDanielx

    GMC Member

  • GMC Member
  • 1002 posts
  • Version:Unknown

Posted 28 May 2007 - 10:03 PM

Tahnok is right, GM can easily set the cursor position on the screen or in the window. I recall that in the older versions of GM there were functions that let the programmer simulate a key press or a mouse click, so a GM program could easily do things like opening the start menu. Were these functions deleted somewhere in the course of production? My memory is a bit foggy, but I don't see them anywhere in the GM7 manual.
  • 0

#16 Tahnok

Tahnok

    Friendly Madman

  • GMC Member
  • 1854 posts
  • Version:GM:Studio

Posted 28 May 2007 - 10:39 PM

Tahnok is right, GM can easily set the cursor position on the screen or in the window. I recall that in the older versions of GM there were functions that let the programmer simulate a key press or a mouse click, so a GM program could easily do things like opening the start menu. Were these functions deleted somewhere in the course of production? My memory is a bit foggy, but I don't see them anywhere in the GM7 manual.

<{POST_SNAPBACK}>

No, GM has only ever been able to simulate key presses, and those are limited to just within GM's window. A dll like this actually is needed for simulating mouse clicks, but it's already been done.
  • 0

gmc_signature.png


#17 xDanielx

xDanielx

    GMC Member

  • GMC Member
  • 1002 posts
  • Version:Unknown

Posted 29 May 2007 - 12:24 AM

No, GM has only ever been able to simulate key presses, and those are limited to just within GM's window. A dll like this actually is needed for simulating mouse clicks, but it's already been done.

<{POST_SNAPBACK}>

From the 5.3 user manual:

keyboard_key_press(key) Simulates a press of the key with the indicated
keycode.
keyboard_key_release(key) Simulates a release of the key with the
indicated keycode.

(LINK)

I remember when toying with the functions that I was able to open the start menu, click shortcut icons in the quick launch bar, etc. on my own computer. I'm unsure of whether GM 5.3 could simulate mouse clicks in the same way (thought there was the mouse_set_screen_position function), but I am sure that keyboard strokes could be simulated.
  • 0

#18 corl455

corl455

    GMC Member

  • New Member
  • 62 posts

Posted 24 June 2007 - 02:13 AM

I have been looking for a dll like this for forever! The only problem is that when
I start the example a screen pops up and says:

'Unexpected error occured while running the game.'

Can anyone help? :)

<{POST_SNAPBACK}>



i had the same error, you HAVE to have gm 6.1 i used 7.0 and it had same error

Edited by corl455, 24 June 2007 - 02:14 AM.

  • 0

#19 Clarkyboy

Clarkyboy

    GMC Member

  • GMC Member
  • 899 posts
  • Version:Unknown

Posted 11 September 2007 - 08:18 AM

Sure, this dll isn't very usefull...
But maybe someone will need it  :(

<{POST_SNAPBACK}>


Not useful, I'm making a maple story bot with it :GM039:
i just hope it works!
  • 0

Acid  :)


#20 tsa05

tsa05

    GMC Member

  • GMC Member
  • 1063 posts
  • Version:GM:Studio

Posted 11 September 2007 - 04:38 PM

The original dll for this (since CyberTwister mentioned seeing one but forgetting where) was made by IceMetalPunk. But it's always good to have another; that topic kinda died away.
  • 0

#21 ditdingiscool

ditdingiscool

    GMC Member

  • New Member
  • 335 posts

Posted 09 December 2007 - 08:18 PM

could you make that it also can simulate the scrol wheel?
  • 0

#22 cbrad24

cbrad24

    GMC Member

  • New Member
  • 96 posts

Posted 14 March 2008 - 02:04 PM

No need for negative numbers. You forget about:

display_mouse_set(x,y) Sets the position of the mouse on the display to the indicated values.

Exactly what's needed if you're going to be doing work outside the window.

Anyway, what can this DLL do that SleeK GeeK's Mouse Solutions DLL can't?

<{POST_SNAPBACK}>

None of u have mentioned all the codes u can use for minipulating the mouse :P
window_mouse_set(x,y) Sets the position of the mouse in the window to the indicated values.
display_mouse_set(x,y) Sets the position of the mouse on the display to the indicated values.
window_view_mouse_get_x(id) Returns the x-coordinate of the mouse with respect to the view with index id.
window_view_mouse_get_y(id) Returns the y-coordinate of the mouse with respect to the view with index id.
window_view_mouse_set(id,x,y) Sets the position of the mouse with respect to the view with index id.
window_views_mouse_get_x() Returns the x-coordinate of the mouse with respect to the view it is in (same as mouse_x).
window_views_mouse_get_y() Returns the y-coordinate of the mouse with respect to the view it is in (same as mouse_y).
window_views_mouse_set(x,y) Sets the position of the mouse with respect to the first view that is visible.
Those are the mouse codes you can use (but i didnt mention with window and display that u can use get_x or get_y instead of set(x,y)
  • 0

#23 FlipSide

FlipSide

    GMC Member

  • New Member
  • 281 posts

Posted 19 April 2008 - 06:54 PM

No need for negative numbers. You forget about:

display_mouse_set(x,y) Sets the position of the mouse on the display to the indicated values.

Exactly what's needed if you're going to be doing work outside the window.

Anyway, what can this DLL do that SleeK GeeK's Mouse Solutions DLL can't?

<{POST_SNAPBACK}>

None of u have mentioned all the codes u can use for minipulating the mouse ^_^
window_mouse_set(x,y) Sets the position of the mouse in the window to the indicated values.
display_mouse_set(x,y) Sets the position of the mouse on the display to the indicated values.
window_view_mouse_get_x(id) Returns the x-coordinate of the mouse with respect to the view with index id.
window_view_mouse_get_y(id) Returns the y-coordinate of the mouse with respect to the view with index id.
window_view_mouse_set(id,x,y) Sets the position of the mouse with respect to the view with index id.
window_views_mouse_get_x() Returns the x-coordinate of the mouse with respect to the view it is in (same as mouse_x).
window_views_mouse_get_y() Returns the y-coordinate of the mouse with respect to the view it is in (same as mouse_y).
window_views_mouse_set(x,y) Sets the position of the mouse with respect to the first view that is visible.
Those are the mouse codes you can use (but i didnt mention with window and display that u can use get_x or get_y instead of set(x,y)


Again, these are for working inside GM's Main Window.

What I'm looking for is to simply check if a Mouse Button is down or up for Windows itself (or any Window that has focus besides GM's Main Window)... so not simulating these, but checking status outside GM's Window.
  • 0

#24 yomomma

yomomma

    GMC Member

  • New Member
  • 367 posts

Posted 05 June 2008 - 11:22 PM

No! It won't work for me. It won't define the DLL for me. I tried to put it in another folder to make a new .gm6 with it and now neither of them work. Maybe I'll have to download it again. Uhh.

Nevermind. It just had to do with which gm6 I had open after moving it. Nice DLL, but not all that useful. No new tricks that haven't been seen before.

Edited by yomomma, 05 June 2008 - 11:29 PM.

  • 0

#25 noobfarm

noobfarm

    GMC Member

  • New Member
  • 128 posts

Posted 30 July 2008 - 11:35 PM

Replying to some of the older posts, you can set the mouse position outside of the windows AND this is much easier to click with instead of tricking GM.
  • 0

#26 Schlynn

Schlynn

    GMC Member

  • New Member
  • 1148 posts

Posted 27 September 2008 - 01:56 AM

It wont download the link when I click on it.
  • 0

#27 Konstantine

Konstantine

    GMC Member

  • New Member
  • 93 posts

Posted 24 November 2008 - 01:52 PM

I know that's an old post, but I thought I should let you know: the example shows "Unexpected error occurred when running the game" to me when it starts.
  • 0



#28 nomar522

nomar522

    GMC Member

  • New Member
  • 124 posts

Posted 27 November 2008 - 06:24 AM

thank you to whoever posted this year(s) ago...really needed it
also, do you need 6.1 to run this?

Edited by nomar522, 27 November 2008 - 06:25 AM.

  • 0

#29 ydawg314

ydawg314

    GMC Member

  • New Member
  • 901 posts
  • Version:Unknown

Posted 02 December 2008 - 09:02 PM

thank you to whoever posted this year(s) ago...really needed it
also, do you need 6.1 to run this?


is it possible to use the middle mouse button?
  • 0
Check out my newest game Redesigned from scratch!
Posted Image
Download Mobile Suit Grunt Wars.zip W.I.P 7-26
TEST YOUR MECH PILOTING SKILLS!!!
Spoiler

#30 van0014

van0014

    GMC Member

  • GMC Member
  • 301 posts
  • Version:GM8.1

Posted 03 March 2009 - 05:46 AM

if you cant work out how to get a joystick to control the mouse i have already made a program that can do it :lol:
  • 0

Proud user of GM 8.1


#31 Yambam

Yambam

    GMC Member

  • GMC Member
  • 647 posts
  • Version:GM8

Posted 28 April 2009 - 09:40 AM

didnt you know
that this sets mouse position? it does do the trick
window_mouse_set(x,y) :)
  • 0

#32 van0014

van0014

    GMC Member

  • GMC Member
  • 301 posts
  • Version:GM8.1

Posted 11 October 2009 - 01:51 AM

how to change the mouses position in GM, using a joystick or gamepad

(download here)
joymouse
  • 0

Proud user of GM 8.1


#33 van0014

van0014

    GMC Member

  • GMC Member
  • 301 posts
  • Version:GM8.1

Posted 08 January 2010 - 11:55 AM

But only in the game window.
window_mouse_set(x,y) Sets the position of the mouse in the window to the indicated values.
Think Before you post.*cough the last three post*
In your face.
<Note This is not intended to start a flame war just to prove you wrong.>
*Evil laugh*

Despite anyones thoughts about this, it is indeed possible to move the mouse outside the game window. It works with negative numbers, for leaving the window. Here is a working link to a program i made ages ago that moves the mouse with a joystick, and also detects when the buttons are pushed, buttons 1 to 4 light up on screen. If you don't believe me, just download it and see for yourself! http://www.yoyogames.../99265-joymouse. If you want to see some of the code i used (NO DLL WHATSOEVER!):
//Complicated accelleration code
if axis!=-1 {if acc<=tspd acc+=(tacc/10)} if axis=-1 acc=spd

mx=window_mouse_get_x()
my=window_mouse_get_y()

if axis=0 {smx=acc; smy=0}
if axis=45 {smx=acc; smy=-acc}
if axis=90 {smy=-acc; smx=0}
if axis=135 {smx=-acc; smy=-acc}
if axis=180 {smx=-acc; smy=0}
if axis=225 {smx=-acc; smy=acc}
if axis=270 {smy=acc; smx=0}
if axis=315 {smx=acc; smy=acc}
if axis=-1 {smx=0; smy=0}

*NO DLL NEEDED!!!!*

//Move the mouse
window_mouse_set(mx+smx,my+smy)
If anyone still thinks this must have a DLL somewhere, why not look for it? Check the game directory! Or even the temp directory! (temp dir isn't made if no files are included i think, so have fun finding it :( ) I needed to prove it IS possible, because some users got a bit cocky about it and i needed to shut 'em up.
  • 0

Proud user of GM 8.1


#34 van0014

van0014

    GMC Member

  • GMC Member
  • 301 posts
  • Version:GM8.1

Posted 08 January 2010 - 12:03 PM

didnt you know
that this sets mouse position? it does do the trick
window_mouse_set(x,y) :(

Excellent, Yambam! You are right, that does set the mouse position. If you read some posts near the top, you may have noticed some users thought that that code wouldn't work. I feel the need to tell them it will.

But only in the game window.
window_mouse_set(x,y) Sets the position of the mouse in the window to the indicated values.
Think Before you post.*cough the last three post*
In your face.
<Note This is not intended to start a flame war just to prove you wrong.>
*Evil laugh*

/\not INTENDED to start a flame war, but it did anyway!/\ lol

Despite anyones thoughts about this, it is indeed possible to move the mouse outside the game window. It works with negative numbers, for leaving the window. Here is a working link to a program i made ages ago that moves the mouse with a joystick, and also detects when the buttons are pushed, buttons 1 to 4 light up on screen. If you don't believe me, just download it and see for yourself! http://www.yoyogames.../99265-joymouse. If you want to see some of the code i used (NO DLL WHATSOEVER!):
//Complicated accelleration code
if axis!=-1 {if acc<=tspd acc+=(tacc/10)} if axis=-1 acc=spd

mx=window_mouse_get_x()
my=window_mouse_get_y()

if axis=0 {smx=acc; smy=0}
if axis=45 {smx=acc; smy=-acc}
if axis=90 {smy=-acc; smx=0}
if axis=135 {smx=-acc; smy=-acc}
if axis=180 {smx=-acc; smy=0}
if axis=225 {smx=-acc; smy=acc}
if axis=270 {smy=acc; smx=0}
if axis=315 {smx=acc; smy=acc}
if axis=-1 {smx=0; smy=0}

*NO DLL NEEDED!!!!*

//Move the mouse
window_mouse_set(mx+smx,my+smy)
If anyone still thinks this must have a DLL somewhere, why not look for it? Check the game directory! Or even the temp directory! (temp dir isn't made if no files are included i think, so have fun finding it :blink: ) I needed to prove it IS possible, because some users got a bit cocky about it.
Dragonos, you really should

Think Before you post


  • 0

Proud user of GM 8.1


#35 Dsarver1

Dsarver1

    GMC Member

  • New Member
  • 1 posts
  • Version:Unknown

Posted 30 December 2011 - 05:14 PM

Im as well trying to make a runescape bot and i hope it works
  • 0

#36 norisak

norisak

    GMC Member

  • GMC Member
  • 131 posts
  • Version:GM8

Posted 05 February 2012 - 11:03 PM

When I try to run it, is says that it got an "UNEXPECTED ERROR".
  • 0

#37 ClearWater

ClearWater

    GMC Member

  • GMC Member
  • 170 posts
  • Version:GM8.1

Posted 10 January 2013 - 08:36 PM

I get the same error. This dll does not work. The topic should be locked. Where are the moderators?
  • 0

#38 van0014

van0014

    GMC Member

  • GMC Member
  • 301 posts
  • Version:GM8.1

Posted 30 January 2013 - 04:22 PM

There are alternatives with the same capabilities

http://gmc.yoyogames...howtopic=478404
http://www.upurload....5b689500815.zip
  • 0

Proud user of GM 8.1