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: "key forwarder", something like this exist?  (Read 2617 times)

0 Members and 1 Guest are viewing this topic.

tony.silveira

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 697
  • Last login:February 17, 2024, 10:24:34 pm
    • my baby
"key forwarder", something like this exist?
« on: January 05, 2012, 09:31:38 pm »
hey all,

in my never ending quest to get all my emu's to behave the same on my arcade machine, i'm curious if anything like a "key forwarder" exists, for lack of a better term.  let me explain, most my emu's pause by hitting the 'P' key.  some of the emu's i have set up use a different key, some are (PAUSE), some are ALT+PAUSE, even got one that is F9, none of these are mappable to a user defined key.

so i was wondering, some key sniffer that when launched before an emu via command line, would listen for the user to hit 'P' and then send the correct key command (PAUSE, F9, ALT+PAUSE, etc.) to the emu running.  not even sure if this would be possible?

just a thought, thanks for reading

Le Chuck

  • Saint, make a poll!
  • Wiki Contributor
  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5509
  • Last login:June 06, 2024, 02:16:34 pm
  • <insert personal text here>
Re: "key forwarder", something like this exist?
« Reply #1 on: January 06, 2012, 12:23:17 am »
Is there an issue with all those buttons being hit at once?  If you have your pause button on your CP being read as a joystick button you can use JoytoKey and map all of those buttons to it so it pauses across multiple platforms.  If it's read as a keyboard input you can get VJoy to map your pause button to a joystick button then use JoytoKey to map it back.  Sounds really retarded to go through all that.  Probably easier to just use autohotkey and set up your pause button to press all those buttons at once, or script autohotkey to do it based on which emulator you are running... all of which it can do.  There are a few ways to skin this cat, and I'm probably missing an even simpler one.   

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2943
  • Last login:August 14, 2023, 02:00:48 am
  • 0x2b|~0x2b?
Re: "key forwarder", something like this exist?
« Reply #2 on: January 06, 2012, 03:24:57 am »
Check out AutoHotkey. You could make up scripts to run before your emu's to remap whatever key to whatever key combo you want.

Eg.
Code: [Select]
p::Pauseor
Code: [Select]
p:::F9or
Code: [Select]
p::{Alt Pause}

Le Chuck

  • Saint, make a poll!
  • Wiki Contributor
  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5509
  • Last login:June 06, 2024, 02:16:34 pm
  • <insert personal text here>
Re: "key forwarder", something like this exist?
« Reply #3 on: January 06, 2012, 01:40:06 pm »
Check out AutoHotkey. You could make up scripts to run before your emu's to remap whatever key to whatever key combo you want.

Eg.
Code: [Select]
p::Pauseor
Code: [Select]
p:::F9or
Code: [Select]
p::{Alt Pause}

Tony, these are spot on except for the code for p to F9 has an extra : should just be p::F9.  If you want them all mapped to the P key you can do this:

Code: [Select]
p::send {pF9Pause}{Alt Down}Pause{Alt up}or
Code: [Select]
p::send pF9Pause^Pause
However depending on what program you're running autohotkey may not do the trick as not all emulators with fixed mapping recognize remapping.  The way around this would be to remap in your registry.  The following is taken from Autohotkey Forums

Remapping via the Registry's "Scancode Map"

Advantages:

    Registry remapping is generally more pure and effective than AutoHotkey's remapping. For example, it works in a broader variety of games, it has no known alt-tab issues, and it is capable of firing AutoHotkey's hook hotkeys (whereas AutoHotkey's remapping requires a workaround).
    If you choose to make the registry entries manually (explained below), absolutely no external software is needed to remap your keyboard. Even if you use KeyTweak to make the registry entries for you, KeyTweak does not need to stay running all the time (unlike AutoHotkey).


Disadvantages:

    Registry remapping is relatively permanent: a reboot is required to undo the changes or put new ones into effect.
    Its effect is global: it cannot create remappings specific to a particular user, application, or locale.
    It cannot send keystrokes that are modified by Shift, Control, Alt, or AltGr. For example, it cannot remap a lowercase character to an uppercase one.
    It is not supported on Windows 95/98/Me (AutoHotkey can do some limited Win9x remapping).
    It supports only the keyboard (AutoHotkey has mouse remapping and some limited joystick remapping).

How to Apply Changes to the Registry: There are at least two methods to remap keys via the registry:

    Use a program like KeyTweak (freeware) to visually remap your keys. It will change the registry for you.
    Remap keys manually by creating a .reg file (plain text) and loading it into the registry. This is demonstrated at www.autohotkey.com/forum/post-56216.html#56216

Let me know what works and what doesn't.

tony.silveira

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 697
  • Last login:February 17, 2024, 10:24:34 pm
    • my baby
Re: "key forwarder", something like this exist?
« Reply #4 on: January 06, 2012, 03:49:06 pm »
i appreciate the feedback guys.  here is what i tried for kega fusion:

#IfWinActive, Fusion 3.64
p::Pause
#IfWinActive

i compiled that script and put the line in my pre-emulator command line.  it runs but it's not pausing like i hoped.  i know it's running cause when i go back to my desktop, the ahk icon is active.

ah well

Le Chuck

  • Saint, make a poll!
  • Wiki Contributor
  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 5509
  • Last login:June 06, 2024, 02:16:34 pm
  • <insert personal text here>
Re: "key forwarder", something like this exist?
« Reply #5 on: January 06, 2012, 04:25:30 pm »
I'm bingo on good advice. Try the guys at AHK help forums and see what they recommend. Make sure and post up once you get it working.

tony.silveira

  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 697
  • Last login:February 17, 2024, 10:24:34 pm
    • my baby
Re: "key forwarder", something like this exist?
« Reply #6 on: January 06, 2012, 06:18:26 pm »
wow, check out the link i found.  not sure how this little app works but it does!

http://www.gameex.info/forums/topic/8121-pause-any-emulator/