Jump to content

All my products and services are free. All my costs are met by donations I receive from my users. If you enjoy using any of my products, please donate to support me. My bare hosting costs are currently not met so please consider donating by either clicking this text or the Patreon link on the right.

Patreon

Recommended Posts

Posted

I found this script on the AutoHotKey forums

http://www.autohotkey.com/forum/topic6107.html

when you run the script the cursor vanishes and when you exit the script the cursors appears again... if you press WindowsKey+C while the script is running it'll toggle the cursor on or off

If you set a batch file to run the script before GameEx and another batch file set to close the script after GameEx exits it should keep the cursor nicely hidden away from view at all times :)

Stu

#SingleInstance force

SystemCursor("Off")

OnExit, ShowCursor ; Ensure the cursor is made visible when the script exits.
return

ShowCursor:
SystemCursor("On")
ExitApp

#c::SystemCursor("Toggle") ; Win+C hotkey to toggle the cursor on and off.

SystemCursor(OnOff=1) ; INIT = "I","Init"; OFF = 0,"Off"; TOGGLE = -1,"T","Toggle"; ON = others
{
static AndMask, XorMask, $, h_cursor
,c0,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10,c11,c12,c13 ; system cursors
, b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12,b13 ; blank cursors
, h1,h2,h3,h4,h5,h6,h7,h8,h9,h10,h11,h12,h13 ; handles of default cursors
if (OnOff = "Init" or OnOff = "I" or $ = "") ; init when requested or at first call
{
$ = h ; active default cursors
VarSetCapacity( h_cursor,4444, 1 )
VarSetCapacity( AndMask, 32*4, 0xFF )
VarSetCapacity( XorMask, 32*4, 0 )
system_cursors = 32512,32513,32514,32515,32516,32642,32643,32644,32645,32646,32648,32649,32650
StringSplit c, system_cursors, `,
Loop %c0%
{
h_cursor := DllCall( "LoadCursor", "uint",0, "uint",c%A_Index% )
h%A_Index% := DllCall( "CopyImage", "uint",h_cursor, "uint",2, "int",0, "int",0, "uint",0 )
b%A_Index% := DllCall("CreateCursor","uint",0, "int",0, "int",0
, "int",32, "int",32, "uint",&AndMask, "uint",&XorMask )
}
}
if (OnOff = 0 or OnOff = "Off" or $ = "h" and (OnOff < 0 or OnOff = "Toggle" or OnOff = "T"))
$ = b ; use blank cursors
else
$ = h ; use the saved cursors

Loop %c0%
{
h_cursor := DllCall( "CopyImage", "uint",%$%%A_Index%, "uint",2, "int",0, "int",0, "uint",0 )
DllCall( "SetSystemCursor", "uint",h_cursor, "uint",c%A_Index% )
}
}

Posted

or you can do this. launch before and after

http://home.cogeco.ca/~icorrupt/nomousy1.5.zip

Quote:

nomousy.exe - A small utility designed to hide and/or restrict mouse cursor movement.

- version 1.5 beta

Options: (all options are NOT case sensitive)

Hide the mouse cursor:

/hide

/h

-hide

-h

hide

h

Restrict the mouse to its' current location:

/freeze

/f

-freeze

-f

freeze

f

Cursor hiding options:

Hide all:

/all

-all

all

Selective hiding:

These following options (with - sign) should not have any spaces between them but may be in any order

UPARROW: -up

ARROW: -ar

IBEAM: -ib

CROSS: -cr

SIZENWSE: -nwse

SIZENESW: -nesw

SIZEWE: -we

SIZENS: -ns

WAIT: -wa

APPSTARTING: -as

ICON: -ic

HAND: -ha

SIZE: -si

SIZEALL: -sa

NO: -no

Restore mouse cursor:

To restore the cursor run nomousy.exe again (with or without options)

Examples:

- hide cursor but allow movement:

nomousy.exe /hide

- hide only ARROW and IBEAM and allow movement:

nomousy.exe -ar-ib

- restrict movement only

nomousy.exe -f

- hide cursor and restrict movement

nomousy.exe /f -h

- restrict movement and hide IBEAM only

nomousy.exe -freeze -ib

- restore cursor

nomousy.exe

Posted

hmmm what if i just want to hide the cursor in certain emus that dont do it properly (like snes9x and some others).

whats the safest way to do this, so that if the emu crashes or whatever the cursor is always restored in gameex or windows?

Posted
hmmm what if i just want to hide the cursor in certain emus that dont do it properly (like snes9x and some others).

whats the safest way to do this, so that if the emu crashes or whatever the cursor is always restored in gameex or windows?

This can be done by adding the following code to the top of the script

GroupAdd HideCursor, GameEx
GroupAdd HideCursor, Zsnes

SetTitleMatchMode 2

loop
{
WinWaitActive, ahk_group HideCursor
SystemCursor("Off")
WinWaitNotActive, ahk_group HideCursor
SystemCursor("On")
}

Create a list of the names of the windows you don't want the cursor to appear in, make sure you have 'GroupAdd HideCursor, ' before the window name, you just need a word that appears anywhere in the window title

here's some common emulators:

GroupAdd HideCursor, Nestopia
GroupAdd HideCursor, Project64
GroupAdd HideCursor, ZSNES
GroupAdd HideCursor, Reality Boy
GroupAdd HideCursor, VisualBoyAdvance
GroupAdd HideCursor, Ootake
GroupAdd HideCursor, nullDC
GroupAdd HideCursor, Fusion
GroupAdd HideCursor, pSX
GroupAdd HideCursor, MESS
GroupAdd HideCursor, Virtual Jaguar
GroupAdd HideCursor, blueMSX
GroupAdd HideCursor, Bliss
GroupAdd HideCursor, MAME:
GroupAdd HideCursor, ZiNc
GroupAdd HideCursor, ahk_class MYWIN
;you need to use ahk_class MYWIN for Model2 Emulator as it's windows title is the game name which obviously changes everytime

Stu

Posted

thats very cool thanks Stu ill try that tomorrow :)

(i take it those are all emus where youve found the cursor showing?)

Posted
thats very cool thanks Stu ill try that tomorrow :)

(i take it those are all emus where youve found the cursor showing?)

Nah those are all the emulators that I'm using for another script I'm working on that will hopefully automatically exit games after a time limit unless more money is inserted to my cabinet.

Nestopia and NullDC show the cursor but I'm not sure about the rest of them, I've been using another script that moves the cursor to the bottom right of the screen when GameEx loads so I haven't really noticed the cursor for a while now.

Stu

Posted

heh yeah i allow the mouse (actually a pointing stick on my airboard) in gameex so cant hide it when gameex loads :P

Posted

This is really cool!

Hey Stu, got a question. Do you know how to send keystrokes to GameEx using AHK? I'm still farting around with that mouse2key thing for using the mouse in list scrolling. The only problem is that GameEx doesn't seem to accept keystrokes when I send them. Any ideas?

EDIT: Sorry, didn't see the other thread before I read this one. I think I'll try to combine this one too to get everything going at once. Sometimes the mouse will pop up even if it's disabled in GameEx, so this will take care of that!

  • 9 months later...
Posted
name='bkenobi' date='Jun 4 2007, 05:29 PM' post='21748']

This is really cool!

Hey Stu, got a question. Do you know how to send keystrokes to GameEx using AHK? I'm still farting around with that mouse2key thing for using the mouse in list scrolling. The only problem is that GameEx doesn't seem to accept keystrokes when I send them. Any ideas?

I downloaded the mouse2key, and manually started it, so AHK is sitting in the system tray. When I run GX, I get this error:

11:31:36.9 4/3/2008: Initialization OK! Starting GameEx!

11:31:37.0 4/3/2008: Testing Main Loop Once: Processing Frame

11:31:38.6 4/3/2008: Testing Main Loop Once: Main Loop ran successfully

11:31:38.7 4/3/2008: 21 Consecutive Exceptions Occured

11:31:38.7 4/3/2008: Index was outside the bounds of the array.

11:31:38.7 4/3/2008: at l.c()

at l.au()

11:31:38.7 4/3/2008: Trying reinitialising the display after sleeping for 4 seconds

11:31:38.7 4/3/2008: Exception count will be dropped to 15

11:31:46.7 4/3/2008: --**--

11:31:46.7 4/3/2008: 21 Consecutive Exceptions Occured: Exiting

11:31:46.7 4/3/2008: Closing database connection

11:31:46.7 4/3/2008: First Exception:

11:31:46.7 4/3/2008: Index was outside the bounds of the array.

11:31:46.7 4/3/2008: at l.c()

11:31:46.7 4/3/2008: at l.au()

11:31:46.7 4/3/2008: Last Exception:

11:31:46.7 4/3/2008: Index was outside the bounds of the array.

11:31:46.7 4/3/2008: at l.c()

11:31:46.7 4/3/2008: at l.au()

Am I doing something wrong?

How would I start and stop it automatically with Gameex?

Posted

The Mouse2Key script shouldn't break GameEx like that. The only problems I have had with the script are that the fast motion portion didn't work. If you have an alpha/paging button set up, you don't need it anyway though.

Posted
The Mouse2Key script shouldn't break GameEx like that. The only problems I have had with the script are that the fast motion portion didn't work. If you have an alpha/paging button set up, you don't need it anyway though.

Ooohhh, now I can only have what I need, and not just things that might be cool? :P

Posted

The fast scrolling would be very cool and *should* be doable. I didn't hash it out completely because I realized my list was only ~2 pages long and that feature wasn't needed. If you want to use it with a spinner/trackball for your main list, it would be MUCH nicer having it. I envisioned whipping my steering wheel and having it shoot down the list which could be the same with a spinner. I can take a quick look later on if it really bothers you. ;)

Posted
The fast scrolling would be very cool and *should* be doable. I didn't hash it out completely because I realized my list was only ~2 pages long and that feature wasn't needed. If you want to use it with a spinner/trackball for your main list, it would be MUCH nicer having it. I envisioned whipping my steering wheel and having it shoot down the list which could be the same with a spinner. I can take a quick look later on if it really bothers you. ;)

Nah, it's no biggie, I just thought it was a done deal, and was going to give it a "spin"!

If you ever do decide to work on it for your own purposes though, Please let us know!

Posted

It's unlikely that I will play much with it again since it works just fine for what I needed. I highly recommend taking a look as the structure is all there for doing the fast scrolling. It's just that for some reason when GameEx receives the PageUp/PageDown keys, it breaks. I hadn't thought about sending both the alpha/paging key and the up/down key at the same time though. That would probably make it work just fine. As it is, you would just have to uncomment the fast scroll sections (remove the semi-colon) and give it a whirl.

Posted

I could try this:

It's unlikely that I will play much with it again since it works just fine for what I needed. I highly recommend taking a look as the structure is all there for doing the fast scrolling. It's just that for some reason when GameEx receives the PageUp/PageDown keys, it breaks. I hadn't thought about sending both the alpha/paging key and the up/down key at the same time though. That would probably make it work just fine. As it is, you would just have to uncomment the fast scroll sections (remove the semi-colon) and give it a whirl.

If it wasn't for this:

I downloaded the mouse2key, and manually started it, so AHK is sitting in the system tray. When I run GX, I get this error:

11:31:36.9 4/3/2008: Initialization OK! Starting GameEx!

11:31:37.0 4/3/2008: Testing Main Loop Once: Processing Frame

11:31:38.6 4/3/2008: Testing Main Loop Once: Main Loop ran successfully

11:31:38.7 4/3/2008: 21 Consecutive Exceptions Occured

11:31:38.7 4/3/2008: Index was outside the bounds of the array.

11:31:38.7 4/3/2008: at l.c()

at l.au()

11:31:38.7 4/3/2008: Trying reinitialising the display after sleeping for 4 seconds

11:31:38.7 4/3/2008: Exception count will be dropped to 15

11:31:46.7 4/3/2008: --**--

11:31:46.7 4/3/2008: 21 Consecutive Exceptions Occured: Exiting

11:31:46.7 4/3/2008: Closing database connection

11:31:46.7 4/3/2008: First Exception:

11:31:46.7 4/3/2008: Index was outside the bounds of the array.

11:31:46.7 4/3/2008: at l.c()

11:31:46.7 4/3/2008: at l.au()

11:31:46.7 4/3/2008: Last Exception:

11:31:46.7 4/3/2008: Index was outside the bounds of the array.

11:31:46.7 4/3/2008: at l.c()

11:31:46.7 4/3/2008: at l.au()

Am I doing something wrong?

How would I start and stop it automatically with Gameex?

Posted

hmmm.... is there a script that will move the mouse to the bottom right of the screen? Then if the emu or gameex crashes for some reason, there's no danger of the mouse not being reactivated.

And - of course - it would be as good as hidden.

I would like to resolve this with vba-m, nestopia, and others as well.

Posted

The "array out of bounds" error is a strange one. That's the one I was seeing before when the script was crashing. The problem is that the fast scrolling kicked in prior to GameEx loading completely I think. Anyway, the simple solution to try (for now) is to just load GameEx first without the script running. Then, after GameEx is up and going, switch back to the desktop and launch the script. It shouldn't crash...

I have a version I run on my racing cab at home and it works just fine. Perhaps the version I uploaded here isn't up to date.

EDIT: Yeah, I took a look at what I posted and it is indeed an older version. I noticed a couple things that were messed with. I don't have the final version, but I edited the one you have a bit to comment out the fast movement section and to initialize the mouse position prior to GameEx starting up. Give this a try:

Mouse2Key__GameEx_.zip

Guest
This topic is now closed to further replies.
×
×
  • Create New...