Attract-Mode Support Forum
Attract-Mode Support => General => Topic started by: kent79 on March 05, 2016, 06:21:09 PM
-
I would like using "mouse" or "touch monitor" instead of joystick to select the game. May I know AM support Mouse control or not? If support, how to activate it? :)
-
Configure->Controls->Up->Add Input
When you are prompted to press the input to be mapped, move the mouse in the direction you want mapped.
Only one mouse is supported ATM. No touch monitor controls.
-
I tried doing this, but the result is extremely slow/erratic The mouse pointer also appears on the screen and jumps around. At first it would only move up, but after exiting and restarting it moves up and down... barely.
Would be really great to be able to "flick" my trackball to rapidly scroll through the list, since the number of games in MAME is huge.
-
Well, I figured out what most of this problem is - the console window is appearing behind AM. But, for whatever reason, the mouse pointer appears whenever the mouse is over that hidden console window, and is also prevents the events from flowing correctly to the UI. It behaves as if the console menu is on top of the UI, which means it doesn't see the mouse movements until the cursor leaves the bounding rect of the console window.
I changed it to start AM with a utility called Hidden Start (hstart.exe) to suppress the console window and now it works better. I also added a hack to mine that switches to page keys if I move the ball really fast (mouse moved more than sensitivity * 2), and that improves the usability some more too.
-
Hello, I haven't tried it myself but I just saw this in another thread:
If you don't care about the console window at all (handy for debugging sometimes), do this:
In attract.cfg, in the general section: change hide_console from no to yes.
That might be simpler to hide the console.
-
Confirmed this also solves the issue. Definitely the better way to do it. :)
-
djrobx - May I learn how you applied the trackball hack for faster wheel scrolling as noted above? Do you suppose the same logic can be applied to the spinner instead?
-
It would work the same for a spinner as it does my trackball, but you might need to assign it to the X axis instead of Y as you see here. It's a filthy dirty, nasty hack to the code but it actually works very nicely. Note that you'd need to specify the keys you use for PageUp and PageDown - this basically "presses" PageUp and PageDown when you move the ball really fast.
In fe_input.cpp, my changes in bold.
case sf::Event::MouseMoved:
if ( e.mouseMove.x < mc_rect.left )
{
m_type = Mouse;
m_code = MouseLeft;
}
else if ( e.mouseMove.y < mc_rect.top )
{
if (e.mouseMove.y < mc_rect.top - (mc_rect.height/2))
{
m_type = Keyboard;
m_code = sf::Keyboard::PageUp;
}
else
{
m_type = Mouse;
m_code = MouseUp;
}
}
else if ( e.mouseMove.x > mc_rect.left + mc_rect.width )
{
m_type = Mouse;
m_code = MouseRight;
}
else if ( e.mouseMove.y > mc_rect.top + mc_rect.height )
{
if (e.mouseMove.y > mc_rect.top + mc_rect.height + (mc_rect.height/2))
{
m_type = Keyboard;
m_code = sf::Keyboard::PageDown;
}
else
{
m_type = Mouse;
m_code = MouseDown;
}
}
break;
I hope it inspires someone to do it properly, maybe hook the mouse movements into the actual wheel acceleration (like you get when you hold a key down).
-
Thank you for the detail. Two questions - are your bolded lines additions to the surrounding code or alterations to lines in existing code? Also, I am unable to locate where the file "fe_input.cpp" is, anywhere in my Attract Mode folder. The common filename extension appears to be *.nut. My system is Win7. Perhaps that applies only to Linux? I'm not a linux guy so that is mere conjecture.
-
The bolded lines are all additions (no lines are modified in this case). This is to the attract mode source code. You'd have to download it, make the changes, and build it, which gives you a new attract.exe. Towards the very bottom is the Windows (native) instructions. Note that step 5 actually downloads the code. Once it does that and you have a successful build you can make the changes to the files.
http://attractmode.org/docs/Compile.html
If you've used the MAME compiler before:
http://headsoft.com.au/index.php?category=mame&page=mc64
It leaves a buildtools folder. That buildtools is the same as MSYS2. So you can just run "buildtools" and then follow steps 2-5.
It looks scary especially if you're not a linux guy, but it went pretty smoothly for me.
-
Much respect for the level of detail in your response. As much as I'd like to implement this, I'm afraid I will need to leave it be. I'm not a coder at all, and what is likely trivial to you is monumental to me. This is clearly far more than I feel I'm able to achieve with the available time I have to attempt to feel my way through it. Maybe one day.
Unless -- if you've already done it, is there any way I can grab your attract.exe, assuming that was the only change? In which case, would I simply replace my existing attract.exe with no other corollary changes?
-
Yep, I can do that for you, but you mentioned that you're using a spinner.
So I need two bits of info: Does your spinner use the X or Y mouse axis? And, are you ok with assigning PgUp and PgDn keys to the wheel movements? If you need different keys I could modify to match whatever you're using.
I synced the original version for a bit and I have to say this "hack" really does do wonders for being able to scroll through the wheel intuitively. It felt so unresponsive without it. :)
-
Much appreciation for the offer.
My cp hasn't quite yet been built and sent to me. Mameroom.com is doing a custom one per my design and I won't learn how they've wired it up to the i-pac until I receive it, though there is still time for me to request certain mapping preferences. Any suggestions? I believe I recall being informed that the spinner will be on the x-axis, and I am okay with PgUp/PgDn, but would that require the i-pac to offer those keys? I am not yet familiar with any of its mapping capabilities.
However, because I will have both a trackball and spinner, after thinking it through further I figured perhaps the trackball would be the better bet, seeing as I am right handed and my trackball will be on the right side (spinner a bit left of center). Spinner would otherwise be my ideal choice, but trackball should work well enough, as per your own experience. Should I assume that rolling the trackball towards me (down?) would cause the names in the wheel to move up (list advancing alphabetically)? I'm using the Nevato theme, in case that matters.
Assuming AM sees both spinner and trackball as mice, then in case I might like the option to try switching back and forth between the spinner and trackball on the fly (both active at the same time even better) for this purpose, could that be achieved by having the spinner set to the y-axis, and if so, what are the caveats of having it on y instead of x, with respect to game play in mame? (e.g. Would Arkanoid still play normally, etc.)
And lastly, would any of this negate the ability to simultaneously retain having a joystick up/down move one at a time?
-
>Assuming AM sees both spinner and trackball as mice, then in case I might like the option to try switching back and forth between the spinner and trackball on the fly (both active at the same time even better) for this purpose, could that be achieved by having the spinner set to the y-axis, and if so, what are the caveats of having it on y instead of x, with respect to game play in mame? (e.g. Would Arkanoid still play normally, etc.)
If you have both a trackball AND a spinner you either need two iPacs (say an iPac and a mini-pac) or you have to assign your spinner to the Z axis. I don't think AM supports the Z axis for mouse input.
MAME's inputs are so configurable that there's really not a big caveat either way for actual gameplay.
If you connect multiple mice, Windows will let you use them all simultaneously as one "mouse". This is the case on my cab too, it has 3 trackballs. I can scroll the wheel from any of the 3 trackballs just fine. AM cannot currently differentiate them though, so I can't automatically rotate the display to where you're sitting (you have to touch the other controls for that). MAME, on the other hand, does know the difference, so two player games can work correctly.
> And lastly, would any of this negate the ability to simultaneously retain having a joystick up/down move one at a time?
Nope not at all.
> and I am okay with PgUp/PgDn, but would that require the i-pac to offer those keys?
No conflict or special requirements there. The real PgDn key can be used, or not, it's fine either way. The hack just "virtually" presses PgDn/PgUp when you spin the ball very fast. I have my U-Hid programmed to hit PgUp/PgDn when I hold the Exit Game button ("Shift key") and press up and down on the joystick. But that has no impact for this spinner hack. Now that the ball is working so well I almost never touch the joystick now. :)
> I am not yet familiar with any of its mapping capabilities.
It's really easy to change things around in the mapping software. I wouldn't stress out about it too much.
-
I wasn't aware, until just now, that having a trackball would force the spinner to the z-axis or require a 2nd keyboard encoder. I'll make that inquiry with the builder and see what can be worked out.
Perhaps it's best, if you're agreeable, to revisit this matter once my cp arrives, hopefully in a week or two, when I'll have a better handle on how things were configured for me?
Thank you so much again for the generous gift of your time in getting this done for me. The community is better off for it.
-
Yep that's what I was thinking. Just let me know when you get your stuff in and we'll work on it then.
-
I now expect to have the cp delivered within a week's time. I'll post again when I have it connected up and ready for your magic.
-
My cp arrived yesterday. As it turns out, as I configure all the control inputs for both AM and mame, I've ended up concluding that the MiniGrip trigger stick I have will suffice perfectly in place of the spinner or trackball for game selection. So thank you again for offering but at this time I feel I am okay as is. Should that change in the future I will hold out hope that you are reachable here.
-
djrobx,
If you're still active here, and still willing (or in his absence, anyone else knowledgeable enough who wishes some extra karma), I'd love the option to take you up on your prior offer from earlier in this thread, for a copy of your modified attract.exe. My spinner is on the x-axis. One question that occurs to me is would I be able to adjust the sensitivity as it relates to the game list scrolling speed when turning the spinner? Also, I am deliberately remaining on AM v.2.2.0.1, and should this all still be doable, I would want the modified attract.exe to be that same version. Please tell me how I can compensate you for the effort.
Thanks in advance