Jump to content


Photo

Dll : Mouse Controller


  • Please log in to reply
40 replies to this topic

#1 CyberTwister

CyberTwister

    GMC Member

  • New Member
  • 243 posts

Posted 28 March 2007 - 10:27 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:15 PM.

  • 1

#2 gm man

gm man

    GMC Member

  • New Member
  • 98 posts
  • Version:Unknown

Posted 30 March 2007 - 09:01 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:33 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:08 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:44 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:25 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 20 April 2007 - 11:47 PM

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 20 April 2007 - 11:55 PM

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

#9 the_doominator

the_doominator

    Eight Star

  • New Member
  • 925 posts

Posted 21 April 2007 - 12:22 AM

he is right....

*grins behind obviously smarter GM member*
  • 0

#10 sleija

sleija

    GMC Member

  • New Member
  • 174 posts

Posted 22 April 2007 - 09:51 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:39 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:23 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
  • 1336 posts
  • Version:GM8

Posted 23 May 2007 - 06:30 AM

Have you unzipped it first?
  • 0

#14 Tahnok

Tahnok

    Friendly Madman

  • GMC Member
  • 1730 posts
  • Version:Unknown

Posted 23 May 2007 - 08:33 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

#15 xDanielx

xDanielx

    GMC Member

  • GMC Member
  • 1001 posts
  • Version:Unknown

Posted 28 May 2007 - 09:49 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
  • 1730 posts
  • Version:Unknown

Posted 28 May 2007 - 10:25 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

#17 xDanielx

xDanielx

    GMC Member

  • GMC Member
  • 1001 posts
  • Version:Unknown

Posted 29 May 2007 - 12:10 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 - 01:59 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:00 AM.

  • 0

#19 Fede-lasse

Fede-lasse

    AI Programmer

  • GMC Member
  • 2009 posts
  • Version:Unknown

Posted 23 July 2007 - 11:07 AM

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

Then here it is: gmaker61.zip from the ORIGINAL game maker site (gamemaker.nl) witch i support ^_^ (see signature)

Edited by fede-lasse, 23 July 2007 - 11:29 AM.

  • 0

#20 Clarkyboy

Clarkyboy

    GMC Member

  • New Member
  • 898 posts

Posted 11 September 2007 - 08:04 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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users