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: the right way to re-map a control  (Read 971 times)

0 Members and 1 Guest are viewing this topic.

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
the right way to re-map a control
« on: October 31, 2004, 12:26:33 am »
I really need an RETURN key on my panel because too many PC games require it but I'm out of keys, so I figured I would remap the 1 key to the RETURN key on my keyWiz.
I figured out the mamewah CTRLR file so I can get mamewah to use the ENTER key instead of the 1 key.

I'm not sure what the right way to do it is in MAME: do I simply go in the TAB menu then change default input for player 1 to ENTER instead of 1?
Do I need to change my CTRLR file?

I'm still really fuzzy on what CTRLR files really do.

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 20, 2025, 03:37:24 pm
  • The Bears Still Suck!
Re:the right way to re-map a control
« Reply #1 on: October 31, 2004, 01:46:58 am »
You could use the tab menu.

The ctrlr files are another way to map control for mame.  I prefer them because you can't do stupid stuff by mistake, like remap the tab menu to esc which can be done easily without realizing it.  Also if you use a viewer like Johnny5, Johnny5 will compare your ctrlr file mappings to controls.dat and show the correct labels for your setup.

However, the ctrlr files have become a little tougher for the newbie to edit. The best way to edit is read how to make the ctrlr files using the old method (available on mameworld's easy emu site) and use HowardC's conversion utility.

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re:the right way to re-map a control
« Reply #2 on: October 31, 2004, 10:02:56 am »
I really need an RETURN key on my panel because too many PC games require it but I'm out of keys, so I figured I would remap the 1 key to the RETURN key on my keyWiz.
I figured out the mamewah CTRLR file so I can get mamewah to use the ENTER key instead of the 1 key.

I'm not sure what the right way to do it is in MAME: do I simply go in the TAB menu then change default input for player 1 to ENTER instead of 1?
Do I need to change my CTRLR file?

I'm still really fuzzy on what CTRLR files really do.


In the ctrlr file, "ports" are the various mame functions, like P1_JOYSTICK_LEFT, etc, and "keycodes" are what keycode your buttons generate.

Edit the "default" section of your ctrlr file and look for these lines:

<port type="START1">
   <newseq type="standard">KEYCODE_1</newseq>
</port>
   
"<port" is a XML tag for start the port description, and "</port>" means to end the port description. These three lines tell MAME to perform the START1 MAME function whenever KEYCODE_1 is pressed.

In your case, you'll want to change KEYCODE_1 to KEYCODE_ENTER. Or you could change it to KEYCODE_1 OR KEYCODE_ENTER to have either enter or 1 be the player 1 start button.

IMO the XML files are a huge improvement and you shouldn't even bother with the old-style ctrlr files. But, use whatever you feel most comfortable with.

I would not change the controls within MAME. It's too easy to mess things up and you'll lose your definitions if you reinstall a new version of MAME if a different directory.

HTH,
Buddabing
I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

papaschtroumpf

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 972
  • Last login:July 23, 2013, 11:41:10 pm
  • Have a Cow!
Re:the right way to re-map a control
« Reply #3 on: October 31, 2004, 10:22:10 am »
that makes sens, I like the idea of defining it with the OR statement so that the default keys still work.

I will also remap my Pause key this way since it's currently remapped from the Tab menu (the KeyWiz doesn't make the letter P available by default)

I assume all I need to do is the following:
         <port type="UI_PAUSE">
            <newseq type="standard">KEYCODE_Q OR KEYCODE_P</newseq>
         </port>

The letter Q is already used for something else by MAME (don't remember what, don't use it), so does my definition take precedence over the exsting MAME definition?
« Last Edit: October 31, 2004, 10:26:52 am by papaschtroumpf »

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • Last login:February 12, 2015, 02:51:45 pm
  • I'm a llama!
Re:the right way to re-map a control
« Reply #4 on: October 31, 2004, 12:19:05 pm »
that makes sens, I like the idea of defining it with the OR statement so that the default keys still work.

I will also remap my Pause key this way since it's currently remapped from the Tab menu (the KeyWiz doesn't make the letter P available by default)

I assume all I need to do is the following:
I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

SirPoonga

  • Puck'em Up
  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 8188
  • Last login:July 20, 2025, 03:37:24 pm
  • The Bears Still Suck!
Re:the right way to re-map a control
« Reply #5 on: November 01, 2004, 11:52:41 am »
IMO the XML files are a huge improvement and you shouldn't even bother with the old-style ctrlr files. But, use whatever you feel most comfortable with.

True, but the old way kept things seperate, which to me was easier.  I have a neogeo.ini, 6button.ini and a couple of others.
Witht he new xml stuff all that gets put into one file and you have to put it in the right order.  That seems like it is more trouble than it is worth.