Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Controller Detection  (Read 2875 times)

0 Members and 1 Guest are viewing this topic.

brock.sampson

  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 379
  • Last login:May 31, 2018, 10:11:41 pm
Controller Detection
« on: February 03, 2010, 11:50:31 am »
I'm thinking about making a track and field style cocktail.  One side will have standard street fighter layout, the other will have a trackball.  I want to use mala's controller detection to flip the screen when using people use one side or the other.  I can get controller detection to work with buttons but I don't know how to configure it to work with a mouse.  Any help would be appreciated.
DOC! YOU HAVE A TABLE OVER THERE WITH A SIGN THAT SAYS, "LASER DEATH RAY BARGAIN BIN!"

loadman

  • Moderator
  • Trade Count: (+3)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 4306
  • Last login:May 26, 2024, 05:14:32 am
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: Controller Detection
« Reply #1 on: February 05, 2010, 08:08:47 pm »
I'm thinking about making a track and field style cocktail.  One side will have standard street fighter layout, the other will have a trackball.  I want to use mala's controller detection to flip the screen when using people use one side or the other.  I can get controller detection to work with buttons but I don't know how to configure it to work with a mouse.  Any help would be appreciated.

You can't as such.

You could add a 'extra' button on the trackball side that could be used to flip the screen?

Stormrider

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:September 28, 2014, 11:01:54 am
Re: Controller Detection
« Reply #2 on: February 06, 2010, 12:02:58 pm »
You you create a very simple autohotkey script (resident) so that when the mouse axes are detected in the mala program, a specific key is sent. Ask here: http://www.autohotkey.com/forum/forum-1.html&sid=28c11465ab545764224006bdf8572b3e

Stormrider

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 318
  • Last login:September 28, 2014, 11:01:54 am
Re: Controller Detection
« Reply #3 on: February 06, 2010, 12:25:15 pm »
OK, I'll save you time. Here's the script. It monitors the mouse every second. If it's moved, the F1 key is pressed. You can change that, of course. You can compile it with the tool provided with Autohotkey and run the exe before MaLa so that it stays resident.

#Persistent
#NoTrayIcon

SetTimer, monitorcursor, 1000

monitorcursor:
IfWinActive MaLa ahk_class TfrmMain
   if !chk_mousepos()
   send, {F1}
return    

chk_mousepos(input=false)
{
   static mousex, mousey
   if !mousex OR !mousey
      MouseGetPos, mousex, mousey
   MouseGetPos, mousex2, mousey2
   if (mousex = mousex2) AND (mousey = mousey2)
      return true
   else
   {
      mousex := mousex2
      mousey := mousey2
      return false
   }    
}